linux下生成随机长度的字符串,这里以生成16位或32位为例:
[root@k8smaster ~]# echo `openssl rand -base64 50 | tr -dc A-Z-a-z-0-9 | head -c${1:-32}`
PHiN0WRxghm5APvgDGpdlRVKdwhj4tcG
[root@k8smaster ~]# echo `openssl rand -base64 50 | tr -dc A-Z-a-z-0-9 | head -c${1:-16}`
PnIYarw1K18AfKiy
