def hash_cmd(bot, event, irc, args):
"""<hashing mechanism> <string to hash>
Returns a hexadecimal digest of the hashed provided string"""
if args[0] in hashlib.algorithms_available:
func = getattr(hashlib, args[0])
irc.reply(event, func(" ".join(args[1:]).encode()).hexdigest())
else:
irc.reply(event, "Unknown hashing mechanism: " + args[0])
评论列表
文章目录