src/test/java/com/sauljohnson/checkers/BsdChecksumCalculatorTests.java
private static byte[] toByteArray(String hex) {
        int len = hex.length();
        byte[] data = new byte[len / 2];
        for (int i = 0; i < len; i += 2) {
            data[i / 2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4) + Character.digit(hex.charAt(i+1), 16));
        }
        return data;
    }
/**
     * Converts a hexadecimal string to a byte array.
     * @param hex   the hexadecimal string to convert
     * @return  the resulting byte array
     */
Converts a hexadecimal string to a byte array.
@param hex   the hexadecimal string to convert
@return  the resulting byte array
Converts a hexadecimal string to a byte array . @param hex the hexadecimal string to convert @return the resulting byte array
private static byte[] toByteArray(String hex) {
        int len = hex.length();
        byte[] data = new byte[len / 2];
        for (int i = 0; i < len; i += 2) {
            data[i / 2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4) + Character.digit(hex.charAt(i+1), 16));
        }
        return data;
    }
private static byte [ ] toByteArray ( String hex ) { int len = hex . length ( ) ; byte [ ] data = new byte [ len / 2 ] ; for ( int i = 0 ; i < len ; i += 2 ) { data [ i / 2 ] = ( byte ) ( ( Character . digit ( hex . charAt ( i ) , 16 ) << 4 ) + Character . digit ( hex . charAt ( i + 1 ) , 16 ) ) ; } return data ; }
Converts a hexadecimal string to a byte array.
Converts a hexadecimal string to a byte array .