-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1599b5d
commit 7253b12
Showing
3 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# -*- cofing: utf-8 -*- | ||
import argparse | ||
import hashlib | ||
|
||
# parsing | ||
parser = argparse.ArgumentParser(description='hashing given password') | ||
parser.add_argument('password', help='input password you want to hash') | ||
parser.add_argument('-t', '--type', default='sha256',choices=['sha256', 'sha512', 'md5'] ) | ||
args = parser.parse_args() | ||
|
||
# hashing given password | ||
password = args.password | ||
hashtype = args.type | ||
m = getattr(hashlib,hashtype)() | ||
m.update(password.encode()) | ||
|
||
# output | ||
print("< hash-type : " + hashtype + " >") | ||
print(m.hexdigest()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
print("Hello World") | ||
# LANGUAGE: Python | ||
# ENV: Python 3 | ||
# AUTHOR: Ayushman Pal | ||
# GITHUB: https://github.com/WannaCry016 | ||
|
||
print("Hello World") |