2009-03-15 06:51:39 +00:00
|
|
|
import hashlib
|
|
|
|
|
2009-03-16 04:30:46 +00:00
|
|
|
import hook
|
|
|
|
|
2009-04-18 00:57:18 +00:00
|
|
|
|
2009-03-16 04:30:46 +00:00
|
|
|
@hook.command
|
2009-03-15 07:25:32 +00:00
|
|
|
def md5(input):
|
|
|
|
return hashlib.md5(input).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-03-15 07:25:32 +00:00
|
|
|
def sha1(input):
|
|
|
|
return hashlib.sha1(input).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-03-15 07:25:32 +00:00
|
|
|
def hash(input):
|
|
|
|
return ', '.join(x + ": " + getattr(hashlib, x)(input).hexdigest()
|
2009-03-15 06:51:39 +00:00
|
|
|
for x in 'md5 sha1 sha256'.split())
|