I'm porting some code from PHP to .NET (I'm not a PHP developer) and it all looks pretty straightforward apart from the following line:
public function hash($message, $secret)
{
return base64_encode(hash_hmac('sha1', $message, $secret));
}
How can I port this function to .NET?
The base64 encoding is done as follows, but how do I replicate hash_hmac()?
Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes(tmpString));
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…