镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Implement randomBytes for emscripten - #99

Open
chirag-parmar wants to merge 2 commits into
cheatfate:masterfrom
chirag-parmar:emscripten
Open

chirag-parmar wants to merge 2 commits into
cheatfate:masterfrom
chirag-parmar:emscripten

Conversation

@chirag-parmar

Copy link
Copy Markdown

Description

Implements randomBytes for emscripten. According to the rust crate getrandom and the PR linked on the same page emscripten-core/emscripten#12240 emscripten wraps getRandomDevice (browser version of obtaining randomness) within the getentropy function.

Changes

  1. Implements randomBytes for emscripten
  2. Merges the logic for randomBytes of openbsd with emscripten. Before this PR, randomBytes within the openbsd segment did not care for the maximum chunk size allowed by getentropy (1, 2). This would resulted in using /dev/urandom for randomness above 256 bytes.
  3. Adds or clause for urandomRead to accomodate for emscripten since users might not define posix flag with emscripten.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant