运维小事件-持续更新
文章目录
运维小事件
Linux系统
系统随机数
# 两种获取随机值的伪设备
/dev/random /dev/urandom
cat /dev/urandom |od -x | tr -d ' '| head -n 1
random 通过进程中断获取随机数,如果中断次数不够会阻塞程序,而urandom是不会阻塞程序,所以random的精度高urandom低些还可能会有重复
Linux系统# 两种获取随机值的伪设备
/dev/random /dev/urandom
cat /dev/urandom |od -x | tr -d ' '| head -n 1
random 通过进程中断获取随机数,如果中断次数不够会阻塞程序,而urandom是不会阻塞程序,所以random的精度高urandom低些还可能会有重复
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论