Skip to content

Instantly share code, notes, and snippets.

@shankerwangmiao
Last active October 11, 2018 14:19
Show Gist options
  • Save shankerwangmiao/b2ba883027c2c151b58cf482c9900290 to your computer and use it in GitHub Desktop.
Save shankerwangmiao/b2ba883027c2c151b58cf482c9900290 to your computer and use it in GitHub Desktop.
#!/bin/bash
function gen {
dd if=/dev/urandom 2>/dev/null | tr -dc a-f0-9 | fold -w $1 | head -n 1 | sed 's/^/0x/'
}
spi=`gen 8`
reqid=`gen 8`
auth_key=`gen 64`
enc_key=`gen 64`
cat << EOF
ENDPOINT=$1
SPI=$spi
REQID=$reqid
AUTH_KEY=$auth_key
ENC_KEY=$enc_key
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment