27
4

1 回答 1

36

只需调用您已经在pwandsalt字符串上提到的方法:

pw_bytes = pw.encode('utf-8')
salt_bytes = salt.encode('utf-8')
return hashlib.sha256(pw_bytes + salt_bytes).hexdigest() + "," + salt
于 2012-11-07T08:02:18.697 回答