-1
Go를 사용하여 Hmac/SHA1 서명을 생성하려고하지만 Node.js 또는 Python으로 테스트 할 때와 다른 결과가 나타납니다.node.js 또는 Python과 다른 결과로 이동하여 서명 된 Hmac/sha1 메시지
signature := hmac.New(sha1.New, []byte(signKey))
signature.Write([]byte(buffer))
return hex.EncodeToString(signature.Sum(nil))
여기 내 코드는 Node.js를에 있어요 :
return crypto.createHmac('sha1', signKey).update(buffer).digest('hex');
파이썬 :
는 여기에 내 코드입니다 당신이 난 것을 알아내는 데 도움이 할 수
return hmac.new(signKey, buffer, sha1).hexdigest()
잘못하고있는거야?
감사합니다.