我正在为 mongodb 创建一个身份验证密钥文件,一种方法是使用:/usr/bin/openssl rand -base64 741 > $TMPFILE
我想了解发生了什么事,除了三个数字741的含义之外,我明白了一切
我在文档中找不到解释。
这意味着它将使用 741 字节的随机数据并对它进行 Base64 处理。
示例,因为-hex 20这将是 40 长。
$ /usr/bin/openssl rand -hex 20
51b40b347dfccefa9b4f8a13d36c4564760c2f82
Run Code Online (Sandbox Code Playgroud)
它在手册页中进行了解释。见num文末及说明:
SYNOPSIS
openssl rand [-help] [-out file] [-rand file...] [-writerand file]
[-base64] [-hex] num
DESCRIPTION
This command generates num random bytes using
cryptographically secure pseudo random number generator (CSPRNG).
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
420 次 |
| 最近记录: |