Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #263 from alphagov/shorter-tokens
Browse files Browse the repository at this point in the history
Generate shorter tokens
  • Loading branch information
robyoung committed Apr 10, 2014
2 parents 673a177 + 1fa2396 commit b352a8d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/generate-token.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash

#
# Generate a random token
# Generate a random token
#

head -c 500 /dev/urandom | shasum -a 512
# LC_CTYPE=C is specified for OS X, as otherwise tr will return
# an illegal byte sequence from assuming /dev/urandom is UTF-8

cat /dev/urandom | LC_CTYPE=C tr -cd 'a-zA-Z0-9' | head -c 64

echo '' # Add a newline

0 comments on commit b352a8d

Please sign in to comment.