openssl rand 发作随机数
openssl rand 产生随机数
<openssl rand>
介绍
openssl rand 用于产生指定长度个bytes的随机字符。
语法
openssl rand[-out file] [-rand file(s)] [-base64] [-hex]num
E:\OpenSSL\foo>openssl rand 10 騆oading 'screen' into random state - done t嬍鴢vA可以看见,这10个字节的随机数显示为乱码,可以用 -out 将随机字符放到一个文件中
-base64 / -hex 对随机字符串进行base64编码或用hex格式显示
E:\OpenSSL\foo>openssl rand -hex 10 Loading 'screen' into random state - done 325567f39cb3dbf15a32
E:\OpenSSL\foo>openssl rand -base64 20 Loading 'screen' into random state - done aA58hKadrquIX1Jfr4COCm9m/NE=