getHash function

String getHash(
  1. String keyS,
  2. String value
)

Implementation

String getHash(String keyS,String value){
  // print("this is sthe va;ue");
  // print(value);
  // var key = utf8.encode(keyS);
  var key=hex.decode(keyS);
  var bytes = utf8.encode(value);
  var hmacSha256 = Hmac(sha256, key); // HMAC-SHA256Txn-1234
  var digest = hmacSha256.convert(bytes);
  return digest.toString().toUpperCase();
}