-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Description
Documentation
The documentation for os.urandom clearly states that for Linux systems getrandom() is used when available (and then depending on python release and Linux version the behavior changes).
The documentation also clearly states that for Windows os.urandom uses BCryptGenRandom (which was previously CryptGenRandom before release 3.11).
The documentation then states that on a "Unix-like system" that reads to /dev/urandom are done.
However macOS is not mentioned (which could technically be covered by the "Unix-like system" and is often misinterpreted that way).
The /mimalloc/prim/unix/prim.c file (around lines 730-760) define macOS functionality using CCRandomGenerateBytes and then falling back to arc4random_buf.
The above functionality should be documented.