![]() | 1 BigZ 2013-01-31 13:51:19 +08:00 python文档里面写的很清楚 It defaults to the hashlib.md5() constructor. |
![]() | 2 shiny 2013-01-31 13:56:31 +08:00 ![]() so it should be hash_hmac("md5","data string to encrypt","key") python下的文档:http://docs.python.org/2/library/hmac.html php下的文档:http://php.net/manual/en/function.hash-hmac.php |
3 enj0y OP @shiny hash_hmac('sha1',"data string to encrypt","key"); is this ok? |
![]() | 4 shiny 2013-01-31 14:07:04 +08:00 ![]() @enj0y hmac.new(key[, msg[, digestmod]]) python 下的 digestmod 默认是md5的,而php下没有默认摘要算法,所以翻译过来是md5。当然指定为sha1、sha256之类都是可以的。 |
5 whtsky 2013-01-31 14:08:55 +08:00 我还以为是某个逆天的工具.... |