9 lines
245 B
Python
Executable file
9 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'])
|