python--sha256

import hmac
import hashlib


def get_hmacsha256(key, message):
key_bytes = bytes(key, 'utf-8')
message_bytes = bytes(message, 'utf-8')
hmacsha256_str = hmac.new(key_bytes, message_bytes, digestmod=hashlib.sha256).hexdigest()
return hmacsha256_str


原文地址:https://www.cnblogs.com/fqfanqi/p/8413481.html