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

public static byte [ ] hash ( String text ) { try { MessageDigest md = MessageDigest . getInstance ( "SHA-256" ) ; md . update ( text . getBytes ( "UTF-8" ) ) ; return md . digest ( ) ; } catch ( Exception e ) { throw new RuntimeException ( "Unable to compute hash while signing request: " + e . getMessage ( ) , e ) ; } }
hashes the string contents ( assumed to be utf - 8 ) using the sha - 256 algorithm .
