First :D
This commit is contained in:
commit
37588421f3
100 changed files with 22673 additions and 0 deletions
28
plugins/hash.py
Normal file
28
plugins/hash.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
import hashlib
|
||||
from util import hook
|
||||
|
||||
@hook.command
|
||||
def md5(inp):
|
||||
".hash <text> -- returns a md5 hash of <text>"
|
||||
return hashlib.md5(inp).hexdigest()
|
||||
|
||||
@hook.command
|
||||
def sha1(inp):
|
||||
".hash <text> -- returns a sha1 hash of <text>"
|
||||
return hashlib.sha1(inp).hexdigest()
|
||||
|
||||
@hook.command
|
||||
def sha256(inp):
|
||||
".hash <text> -- returns a sha256 hash of <text>"
|
||||
return hashlib.sha256(inp).hexdigest()
|
||||
|
||||
@hook.command
|
||||
def sha512(inp):
|
||||
".hash <text> -- returns a sha512 hash of <text>"
|
||||
return hashlib.sha512(inp).hexdigest()
|
||||
|
||||
@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'.split())
|
Reference in a new issue