2009-03-15 06:51:39 +00:00
|
|
|
import hashlib
|
|
|
|
|
2009-07-08 17:04:30 +00:00
|
|
|
from util import hook
|
2009-03-16 04:30:46 +00:00
|
|
|
|
2009-04-18 00:57:18 +00:00
|
|
|
|
2009-03-16 04:30:46 +00:00
|
|
|
@hook.command
|
2009-11-19 01:49:51 +00:00
|
|
|
def md5(inp):
|
|
|
|
return hashlib.md5(inp).hexdigest()
|
2009-03-15 06:51:39 +00:00
|
|
|
|
2009-04-18 00:57:18 +00:00
|
|
|
|
2009-03-16 04:30:46 +00:00
|
|
|
@hook.command
|
2009-11-19 01:49:51 +00:00
|
|
|
def sha1(inp):
|
|
|
|
return hashlib.sha1(inp).hexdigest()
|
2009-03-15 06:51:39 +00:00
|
|
|
|
2009-04-18 00:57:18 +00:00
|
|
|
|
2009-03-16 04:30:46 +00:00
|
|
|
@hook.command
|
2009-11-19 01:49:51 +00:00
|
|
|
def hash(inp):
|
|
|
|
return ', '.join(x + ": " + getattr(hashlib, x)(inp).hexdigest()
|
2009-03-15 06:51:39 +00:00
|
|
|
for x in 'md5 sha1 sha256'.split())
|