Skip to content

Instantly share code, notes, and snippets.

@bobbyno
Created January 12, 2016 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bobbyno/36a1ba64ef3e9da34a2a to your computer and use it in GitHub Desktop.
Save bobbyno/36a1ba64ef3e9da34a2a to your computer and use it in GitHub Desktop.
Generate a sha-256 digest for input
#!/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