@Test public void encodeWithCheckSum() throws Exception { Random random = new Random(); for (int i = 1; i < 100; i++) { byte[] bytes = new byte[i]; random.nextBytes(bytes); String data = Base58.encodeWithCheckSum(bytes); assertTrue(ByteUtils.equals(bytes, Base58.decode(data))); } }
public static String encodeWithCheckSum(byte[] keyData) { String key = encode(keyData); ByteBuffer buffer = ByteBuffer.allocate(4); buffer.putInt(key.hashCode()); return encode(buffer.array()) + "@" + key; }
Base58 { public static String encodeWithCheckSum(byte[] keyData) { String key = encode(keyData); ByteBuffer buffer = ByteBuffer.allocate(4); buffer.putInt(key.hashCode()); return encode(buffer.array()) + "@" + key; } }
Base58 { public static String encodeWithCheckSum(byte[] keyData) { String key = encode(keyData); ByteBuffer buffer = ByteBuffer.allocate(4); buffer.putInt(key.hashCode()); return encode(buffer.array()) + "@" + key; }  }
Base58 { public static String encodeWithCheckSum(byte[] keyData) { String key = encode(keyData); ByteBuffer buffer = ByteBuffer.allocate(4); buffer.putInt(key.hashCode()); return encode(buffer.array()) + "@" + key; }  static String encodeWithCheckSum(byte[] keyData); static String encode(byte[] input); static @Nullable byte[] decode(@NotNull String input); }
Base58 { public static String encodeWithCheckSum(byte[] keyData) { String key = encode(keyData); ByteBuffer buffer = ByteBuffer.allocate(4); buffer.putInt(key.hashCode()); return encode(buffer.array()) + "@" + key; }  static String encodeWithCheckSum(byte[] keyData); static String encode(byte[] input); static @Nullable byte[] decode(@NotNull String input);  }