I have the following PHP function
public function encodePassword($raw, $salt)
{
return hash_hmac('sha1', $raw . $salt, $this->secret);
}
which I need to translate to Go. I found the following example, but it doesn't involve secret key. https://gobyexample.com/sha1-hashes
How can I create a function in Go, that produces exactly same result as PHP's hash_hmac?
Update: After Leo's answer, found this resource with hmac examples in many languages: https://github.com/danharper/hmac-examples. Can be useful to somebody.