Formatting code for MD5String


show source only

======Compute MD5 hash of a string======

This script computes md5 hashes of striings given as arguments

====Requirements====

~-python3

Tested on Linux.

====The script (version 1.0.0)====

%%(python;1;md5string.py)
#!/usr/bin/env python3

# MD5String - compute md5 hashes of given strings
# Copyright (C) 2016 Ɓukasz "Cyber Killer" Korpalski
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import hashlib,sys,os

if len(sys.argv) > 1:
for msgstring in sys.argv:
if msgstring != sys.argv[0]:
print(hashlib.md5(msgstring.encode('utf-8')).hexdigest() + " " + msgstring)
else:
print("Usage: " + os.path.basename(sys.argv[0]) + " <string1> [string2...]")
print("(hint: for strings with white characters wrap them in \"\")")
%%

Just click grab to save the file, or copy&paste it yourself to your favorite editor. Remember to add executable permissions.

====License====

This program is under the [[http://www.gnu.org/licenses/gpl.html GNU GPL v3]] or later.

----
CategoryProjekty
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki