HomePhabricator

[Wilds] Use "random_bytes()" if it is available (after PHP7)

Description

[Wilds] Use "random_bytes()" if it is available (after PHP7)

Summary:
Ref T13209. In PHP7 and newer, the function random_bytes() gives us simple access to cryptographic randomness across platforms. Prefer it if it's available.

Notably, the other sources often aren't available on Windows, and particularly aren't available on a clean/default install with modern software versions. So the major motivation is to make things work better out-of-the-box on Windows.

Test Plan: On Windows, saw Filesystem unit tests which call readRandomBytes() now pass.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13209

Differential Revision: https://secure.phabricator.com/D19726