{
Secret=secret?? "";
Var encoding=new System. Text. UTF8Encoding (); and
Byte [] keyByte=encoding. GetBytes (secret);
Byte [] messageBytes=encoding. GetBytes (message);
Using (var hmacsha256=new hmacsha256 (keyByte))
{
Byte [] hashmessage=hmacsha256.Com puteHash (messageBytes);
Return BitConverter. ToString (hashmessage). Replace (" - ", ""). ToLower ();
}
}
CodePudding user response:
This wouldn't have turned, you understand it directly findThis code is "HMACSHA256 encryption algorithm
"Baidu directly into "https://www.baidu.com/s? Wd=python % 20 hmacsha256 & amp; Rsv_spt=1 & amp; Rsv_iqid=0 x9322cdd0000b3bdb & amp; Issp=1 & amp; F=8 & amp; Rsv_bp=1 & amp; Rsv_idx=2 & amp; Ie=utf-8 & amp; Tn=baiduhome_pg & amp; Rsv_enter=1 & amp; Rsv_dl=tb& Rsv_n=2 & amp; Rsv_sug3=8 & amp; Rsv_sug1=2 & amp; Rsv_sug7=100 & amp; Rsv_sug2=0 & amp; InputT=5588 & amp; Rsv_sug4=5589"
CodePudding user response: