代码之家  ›  专栏  ›  技术社区  ›  Anonymous

sha512如何创建比它提供的字符串更大的哈希?

  •  -2
  • Anonymous  · 技术社区  · 6 年前

    sha512
    下面是一个例子(在python中):

    Python 3.6.0 (default, Jan 13 2017, 00:00:00) 
    [GCC 4.8.4] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import hashlib
    >>> string='-'*10000
    >>> hash=hashlib.sha512(string.encode('utf-8'))
    >>> hash.hexdigest()
    '0d1e23b51e718f4e67c371a16e0f91fefce2802c0b674374e0e0e3309f0e10936a3b96aa0e29d44ad0ba23d0a019f3ff57bfd260b2ed4b6a06c2d343a6dc1800'
    >>> len(string)
    10000
    >>> len(hash.hexdigest())
    128
    

    1 回复  |  直到 6 年前
        1
  •  1
  •   zaph    6 年前