diff options
author | Andinus <andinus@inventati.org> | 2020-03-16 17:29:15 +0530 |
---|---|---|
committer | Andinus <andinus@inventati.org> | 2020-03-16 17:29:15 +0530 |
commit | b75359931e3c5baaded6d0addb6d28f750dcd518 (patch) | |
tree | d21197d18dad2bc58d081263c0192abc7110edaa /hibp/hash.go | |
parent | 553079dc017a44164cd04d4c067c061003e1684f (diff) | |
download | orion-b75359931e3c5baaded6d0addb6d28f750dcd518.tar.gz |
Add initial version of orion v0.1.0
Diffstat (limited to 'hibp/hash.go')
-rw-r--r-- | hibp/hash.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hibp/hash.go b/hibp/hash.go new file mode 100644 index 0000000..25249ed --- /dev/null +++ b/hibp/hash.go @@ -0,0 +1,15 @@ +package hibp + +import ( + "crypto/sha1" + "encoding/hex" + "strings" +) + +// GetHsh takes a string as an input & returns SHA-1 Hash +func GetHsh(pass string) string { + alg := sha1.New() + alg.Write([]byte(pass)) + + return strings.ToUpper(hex.EncodeToString(alg.Sum(nil))) +} |