server/src/main/java/net/johanbasson/neo/domain/common/Base58.java
/**
     * Decodes the given base58 string into the original data bytes, using the checksum in the
     * last 4 bytes of the decoded data to verify that the rest are correct. The checksum is
     * removed from the returned data.
     *
     * @param input the base58-encoded string to decode (which should include the checksum)
     * @throws IllegalArgumentException if the input is not base 58 or the checksum does not validate.
     */
Decodes the given base58 string into the original data bytes, using the checksum in the
last 4 bytes of the decoded data to verify that the rest are correct. The checksum is
removed from the returned data.

@param input the base58-encoded string to decode (which should include the checksum)
@throws IllegalArgumentException if the input is not base 58 or the checksum does not validate.
Decodes the given base58 string into the original data bytes using the checksum in the last 4 bytes of the decoded data to verify that the rest are correct . The checksum is removed from the returned data . @param input the base58 - encoded string to decode ( which should include the checksum ) @throws IllegalArgumentException if the input is not base 58 or the checksum does not validate .
public static byte[] decodeChecked(String input) throws IllegalArgumentException {
        byte[] decoded  = decode(input);
        if (decoded.length < 4)
            throw new IllegalArgumentException("Input too short");
        byte[] data = Arrays.copyOfRange(decoded, 0, decoded.length - 4);
        byte[] checksum = Arrays.copyOfRange(decoded, decoded.length - 4, decoded.length);
        byte[] actualChecksum = Arrays.copyOfRange(Sha256Hash.hashTwice(data), 0, 4);
        if (!Arrays.equals(checksum, actualChecksum))
            throw new IllegalArgumentException("Checksum does not validate");
        return data;
    }
public static byte [ ] decodeChecked ( String input ) throws IllegalArgumentException { byte [ ] decoded = decode ( input ) ; if ( decoded . length < 4 ) throw new IllegalArgumentException ( "Input too short" ) ; byte [ ] data = Arrays . copyOfRange ( decoded , 0 , decoded . length - 4 ) ; byte [ ] checksum = Arrays . copyOfRange ( decoded , decoded . length - 4 , decoded . length ) ; byte [ ] actualChecksum = Arrays . copyOfRange ( Sha256Hash . hashTwice ( data ) , 0 , 4 ) ; if ( ! Arrays . equals ( checksum , actualChecksum ) ) throw new IllegalArgumentException ( "Checksum does not validate" ) ; return data ; }
Decodes the given base58 string into the original data bytes, using the checksum in the
 last 4 bytes of the decoded data to verify that the rest are correct.
Decodes the given base58 string into the original data bytes using the checksum in the last 4 bytes of the decoded data to verify that the rest are correct .