开发者

Is there a function that can turn a string into a hash? [closed]

Closed. This question needs开发者_如何学C details or clarity. It is not currently accepting answers.

Want to improve this question? Add details and clarify the problem by editing this post.

Closed 8 years ago.

Improve this question

Ideally, 14 characters? Or, whatever works.


hashlib

This module implements a common interface to many different secure hash and message digest algorithms. Included are the FIPS secure hash algorithms SHA1, SHA224, SHA256, SHA384, and SHA512 as well as RSA’s MD5 algorithm.


14 hex digits is 56 bits.
14 base64 digits is 84 bits.

md5 is 128 bits, and sha1 is 160, so you could use a truncation of those - both can be generated by hashlib, along with other more recent sha2 hashes.

Which hash is appropriate depends on what the purpose of the hash is.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜