diff options
-rw-r--r-- | shellrc.d/common | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/shellrc.d/common b/shellrc.d/common index 73707c5..7fc8047 100644 --- a/shellrc.d/common +++ b/shellrc.d/common @@ -47,6 +47,15 @@ genpasswd() { tr -dc A-Za-z0-9_ < /dev/urandom | head -c "$l" | xargs } +# Generate random hex number of given lenght +genhex() { + if [ -z "$1" ]; then + echo "Size is required as first argument!" >&2 + return 1 + fi + tr -dc 0-9A-F < /dev/urandom | head -c "$1" | xargs +} + # Automatic branch merger (merge branch, push it to server and remove branch) # Expects name of the branch as argument gitbmerge() { |