src/ru/iitdgroup/nir/SHA256.java
/**
     * Convert byte to human-readable HEX letters
     * @param digestByte byte to convert
     * @return 2 characters string
     */
Convert byte to human-readable HEX letters
@param digestByte byte to convert
@return 2 characters string
Convert byte to human - readable HEX letters @param digestByte byte to convert @return 2 characters string
protected static String byteToString(byte digestByte) {
        /*
        Binary AND Operator copies a bit to the result if it exists in both operands.
        Example (A & B) will give 12 which is 0000 1100
        Bitwise operator works on bits and performs bit-by-bit operation. Assume if a = 60 and b = 13; now in binary format they will be as follows −
a = 0011 1100
b = 0000 1101
a&b = 0000 1100
        */
        return Integer.toString((digestByte & 0xff) + 0x100, 16).substring(1);
    }
protected static String byteToString ( byte digestByte ) { /*
        Binary AND Operator copies a bit to the result if it exists in both operands.
        Example (A & B) will give 12 which is 0000 1100


        Bitwise operator works on bits and performs bit-by-bit operation. Assume if a = 60 and b = 13; now in binary format they will be as follows −

a = 0011 1100

b = 0000 1101

a&b = 0000 1100
        */ return Integer . toString ( ( digestByte & 0xff ) + 0x100 , 16 ) . substring ( 1 ) ; }
Convert byte to human-readable HEX letters
 @param digestByte byte to convert
 @return 2 characters string
Convert byte to human - readable HEX letters @param digestByte byte to convert @return 2 characters string
//TODO: what is the "magic" 0x100 ? //TODO: understand "&" operator https://www.baeldung.com/java-bitwise-operators