Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haslib_sha256, 获取 hashlib 的 sha256 哈希值 #100

Closed
mindjun opened this issue Aug 20, 2018 · 4 comments
Closed

haslib_sha256, 获取 hashlib 的 sha256 哈希值 #100

mindjun opened this issue Aug 20, 2018 · 4 comments
Milestone

Comments

@mindjun
Copy link
Contributor

mindjun commented Aug 20, 2018

背景

  • fish_common.hmac_sha256 提供了 hmac 包的 sha256 哈希值
  • 有时候计算哈希值需要用到 hashlib 包中的 sha256 算法

步骤

  • 定义类 GetSha256,该类包含两个静态方法: hmac_sha256hashlib_sha256

举例

>>> message = 'Hello HMAC'
>>> secret = '12345678'
>>> hmac_str = GetSha256.hmac_sha256(secret, message)
>>> hmac_str 
'5eb8bdabdaa43f61fb220473028e49d40728444b4322f3093decd9a356afd18f'
>>> hashlib_str = GetSha256.hashlib_sha256(message)
'4a1601381dfb85d6e713853a414f6b43daa76a82956911108512202f5a1c0ce4'
@mindjun mindjun added this to the v1.1.1 milestone Aug 20, 2018
@itaa itaa modified the milestones: v1.1.1, v1.1.2 Oct 12, 2018
@wingfish
Copy link
Contributor

wingfish commented Nov 8, 2018

标题英文没有空格,全部检查修改一下吧

@mindjun mindjun changed the title haslib_sha256, 获取hashlib的sha256哈希值 haslib_sha256, 获取 hashlib 的 sha256 哈希值 Nov 8, 2018
@mindjun
Copy link
Contributor Author

mindjun commented Nov 8, 2018

标题空格已经修改了

This was referenced Nov 24, 2018
@wingfish
Copy link
Contributor

有时候计算哈希值时需要hashlib包的sha256哈希值,基础的哈希值

这句话通顺么?

@mindjun
Copy link
Contributor Author

mindjun commented Nov 26, 2018

语句不太通顺,修改为:有时候计算哈希值需要用到 hashlib 包中的 sha256 算法。
这样描述会更加清晰。

@itaa itaa closed this as completed Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants