This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
CloudBot/plugins/hash.py

10 lines
232 B
Python
Raw Normal View History

2011-11-20 10:23:31 +01:00
import hashlib
from util import hook
2012-04-02 18:17:55 +02:00
2011-11-20 10:23:31 +01:00
@hook.command
def hash(inp):
2012-05-16 21:45:16 +02:00
"hash <text> -- Returns hashes of <text>."
2011-11-20 10:23:31 +01:00
return ', '.join(x + ": " + getattr(hashlib, x)(inp).hexdigest()
2012-05-10 21:40:27 +02:00
for x in ['md5', 'sha1', 'sha256'])