Last active
February 1, 2023 15:01
-
-
Save brohee/d411ddb840bb1268c9f31626ef73ff08 to your computer and use it in GitHub Desktop.
Generate long random numerical string in shell for e.g. PIN generation
This file contains 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
#!/bin/sh | |
dd if=/dev/random bs=15 count=1 2>/dev/null | od -D | cut -c 15- | tr -d ' ' | head -1 | |
# alias pin4="dd if=/dev/random bs=15 count=1 2>/dev/null | od -D | cut -c 15- | tr -d ' ' | head -1 |cut -c 1-4" | |
# alias pin6="dd if=/dev/random bs=15 count=1 2>/dev/null | od -D | cut -c 15- | tr -d ' ' | head -1 |cut -c 1-6" | |
# alias pin8="dd if=/dev/random bs=15 count=1 2>/dev/null | od -D | cut -c 15- | tr -d ' ' | head -1 |cut -c 1-8" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment