Created
January 12, 2016 16:46
-
-
Save bobbyno/36a1ba64ef3e9da34a2a to your computer and use it in GitHub Desktop.
Generate a sha-256 digest for input
This file contains hidden or 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
#!/usr/bin/env bash | |
set -eu | |
# Generate a SHA 256 digest for input | |
# usage: str2sha somayyeh | |
# => 393acf6c45aee507aeadfa71b49afdf82e4683ca6ff320bd3d06b878ddac93cf | |
echo $1 | shasum -a 256 | awk '{print $1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment