Edgewall Software

Ticket #2570: hex_entropy_sha.diff

File hex_entropy_sha.diff, 462 bytes (added by cmlenz, 4 years ago)

Patch to use SHA instead of MD5 in hex_entropy

  • trac/util/__init__.py

     
    255255# -- crypto utils 
    256256 
    257257def hex_entropy(bytes=32): 
    258     import md5 
     258    import sha 
    259259    import random 
    260     return md5.md5(str(random.random())).hexdigest()[:bytes] 
     260    return sha.new(str(random.random())).hexdigest()[:bytes] 
    261261 
    262262 
    263263# Original license for md5crypt: