怎么使用 /dev/urandom 生成固定长度的随机数?

版权声明:精心研究,潜心学习,本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_33468857/article/details/86293277

随机纯数字(20位为例):

head /dev/urandom | tr -dc 0-9 | head -c 20

随机小写字母+数字(20位为例):

head /dev/urandom | tr -dc a-z0-9 | head -c 20

随机大小写字母+数字(20位为例):

head  /dev/urandom  |  tr -dc A-Za-z0-9  | head -c 20

猜你喜欢

转载自blog.csdn.net/qq_33468857/article/details/86293277