shell生成随机32位Token
2020-05-21shell生成随机32位Token
1、cat /proc/sys/kernel/random/uuid
07e73165-1196-4194-98bb-a3bf7c96e34a
2、str=$(cat /proc/sys/kernel/random/uuid |sed 's/-//g')
UPPERCASE=$(echo $str | tr '[a-z]' '[A-Z]')
echo $UPPERCASE
3、wc -c数字符
4、str=$(head -c 500 /dev/urandom | tr -dc [:alnum:]| head -c10)