如何将sha256 R输出R与Python匹配

问题描述 投票:0回答:1

我正在尝试从Python的R代码中复制加盐的sha256输出:

library(openssl)
res = sha256("[email protected]", key = "111")  
res
# [1] "172f052058445afd9fe3afce05bfec573b5bb4c659bfd4cfc69a59d1597a0031"
import hashlib, binascii
dk = hashlib.pbkdf2_hmac(='sha256', b'[email protected]', b'111', 0)
binascii.hexlify(dk)
# b'494c86307ffb9e9e31c4ec8782af6498e91272c011a316c242d9164d765be257'

我如何在python中匹配R?

python r hash sha256 salt
1个回答
1
投票

我无法完全重现您的问题。以下键匹配

© www.soinside.com 2019 - 2024. All rights reserved.