📜  python 转换为 hmac sha256 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:20.490000             🧑  作者: Mango

代码示例1
import hmac
import hashlib
import base64
dig = hmac.new(b'1234567890', msg=your_bytes_string, digestmod=hashlib.sha256).digest()
base64.b64encode(dig).decode()      # py3k-mode
'Nace+U3Az4OhN7tISqgs1vdLBHBEijWcBeCqL5xN9xg='