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