#!/bin/bash # # Takes in an e-mail address and answers back with the expected hash used # for the AWS Cognito username field. # args=`getopt e: $*` if [ $? != 0 ]; then echo "Usage: ..." exit 2 fi set -- $args for i do case "$i" in -e) earg="$2"; shift; shift;; esac done if [ "X$earg" == "X" ]; then echo "Usage: ..." exit 3 else echo -n $earg | shasum -a 256 | cut -d " " -f 1 | xxd -r -p | base64 fi