@Test public void testEncodeWithCheck() { assertEquals(ENCODED_WITH_CHECKSUM, Base58Utils.encodeWithCheck(DECODED_WITH_CHECKSUM)); assertEquals("", Base58Utils.encodeWithCheck(new byte[0])); assertEquals("", Base58Utils.encodeWithCheck(null)); }
public static String encodeWithCheck(final byte[] rawData) { if (null == rawData || rawData.length == 0) { return ""; } final byte[] checkSum = calculateCheckSum(rawData); final byte[] rawTotal = new byte[rawData.length + CHECKSUM_LEN]; System.arraycopy(rawData, 0, rawTotal, 0, rawData.length); System.arraycopy(checkSum, 0, rawTotal, rawTotal.length - CHECKSUM_LEN, CHECKSUM_LEN); return encode(rawTotal); }
Base58Utils { public static String encodeWithCheck(final byte[] rawData) { if (null == rawData || rawData.length == 0) { return ""; } final byte[] checkSum = calculateCheckSum(rawData); final byte[] rawTotal = new byte[rawData.length + CHECKSUM_LEN]; System.arraycopy(rawData, 0, rawTotal, 0, rawData.length); System.arraycopy(checkSum, 0, rawTotal, rawTotal.length - CHECKSUM_LEN, CHECKSUM_LEN); return encode(rawTotal); } }
Base58Utils { public static String encodeWithCheck(final byte[] rawData) { if (null == rawData || rawData.length == 0) { return ""; } final byte[] checkSum = calculateCheckSum(rawData); final byte[] rawTotal = new byte[rawData.length + CHECKSUM_LEN]; System.arraycopy(rawData, 0, rawTotal, 0, rawData.length); System.arraycopy(checkSum, 0, rawTotal, rawTotal.length - CHECKSUM_LEN, CHECKSUM_LEN); return encode(rawTotal); }  }
Base58Utils { public static String encodeWithCheck(final byte[] rawData) { if (null == rawData || rawData.length == 0) { return ""; } final byte[] checkSum = calculateCheckSum(rawData); final byte[] rawTotal = new byte[rawData.length + CHECKSUM_LEN]; System.arraycopy(rawData, 0, rawTotal, 0, rawData.length); System.arraycopy(checkSum, 0, rawTotal, rawTotal.length - CHECKSUM_LEN, CHECKSUM_LEN); return encode(rawTotal); }  static String encode(final byte[] input); static byte[] decode(final String input); static String encodeWithCheck(final byte[] rawData); static byte[] decodeWithCheck(final String encoded); }
Base58Utils { public static String encodeWithCheck(final byte[] rawData) { if (null == rawData || rawData.length == 0) { return ""; } final byte[] checkSum = calculateCheckSum(rawData); final byte[] rawTotal = new byte[rawData.length + CHECKSUM_LEN]; System.arraycopy(rawData, 0, rawTotal, 0, rawData.length); System.arraycopy(checkSum, 0, rawTotal, rawTotal.length - CHECKSUM_LEN, CHECKSUM_LEN); return encode(rawTotal); }  static String encode(final byte[] input); static byte[] decode(final String input); static String encodeWithCheck(final byte[] rawData); static byte[] decodeWithCheck(final String encoded);  }