@Test
    void testEncodeDecode2() {
        final SecureRandom secureRandom = new SecureRandom();
        final Random random = new Random();
        for (int i = 0; i < 100; i++) {
            final String input = StringUtil.createRandomCode(secureRandom, random.nextInt(100) + 1);
            final byte[] inputBytes = input.getBytes(StandardCharsets.UTF_8);
            final String base58 = Base58.encode(inputBytes);
            final byte[] outputBytes = Base58.decode(base58);

            Assertions.assertThat(outputBytes)
                    .isEqualTo(inputBytes);

            final String output = new String(outputBytes);

            Assertions.assertThat(output)
                    .isEqualTo(input);
        }
    }
Encode/decode may random strings of different lengths to make sure it is reversible
stroom-util/src/test/java/stroom/util/string/TestBase58.java