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
2013-09-04 18:30:04 +08:00

10 lines
245 B
Python
Executable file

import hashlib
from util import hook
@hook.command
def hash(inp):
"""hash <text> -- Returns hashes of <text>."""
return ', '.join(x + ": " + getattr(hashlib, x)(inp).hexdigest()
for x in ['md5', 'sha1', 'sha256'])