public static byte[] hash(byte[] data){
  try {
    MessageDigest md=MessageDigest.getInstance("SHA-256");
    md.update(data);
    return md.digest();
  }
 catch (  Exception e) {
    throw new RuntimeException("Unable to compute hash while signing request: " + e.getMessage(),e);
  }
}

public static byte [ ] hash ( byte [ ] data ) { try { MessageDigest md = MessageDigest . getInstance ( "SHA-256" ) ; md . update ( data ) ; return md . digest ( ) ; } catch ( Exception e ) { throw new RuntimeException ( "Unable to compute hash while signing request: " + e . getMessage ( ) , e ) ; } }
hashes the byte array using the sha - 256 algorithm .
