#!/bin/bash

LENGTH=32

# If $1 then set it to $LENGTH
if [ -n "$1" ]; then
    LENGTH=$1
fi

# Generate a random string of a-zA-Z0-9 with length
SECRET=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c $LENGTH)

echo $SECRET
