blog.lujun9972.win

读:Python 随机数生成——从 random 到 secrets (opens in new tab)

Python 提供了两个随机数模块——random 用于普通场景,secrets 用于密码学安全场景。本文从随机整数、随机浮点数、随机选择讲起,演示伪随机数的可复现机制,最后介绍 secrets 模块的用法和选择依据。

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help