Gathering detailed insights and metrics for randomness-extractors
Gathering detailed insights and metrics for randomness-extractors
Gathering detailed insights and metrics for randomness-extractors
Gathering detailed insights and metrics for randomness-extractors
Extract (hopefully) almost uniform random bit from source(s) of biased and correlated bits.
npm install randomness-extractors
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
21 Commits
1 Branches
1 Contributors
Updated on Jun 15, 2020
Latest Version
1.0.0
Package Id
randomness-extractors@1.0.0
Size
14.65 kB
NPM Version
5.0.0
Node Version
8.0.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
5
Extract (hopefully) almost uniform random bit from source(s) of biased and correlated bits.
npm install --save randomness-extractors
Reference: J. Von Neumann, “Various techniques used in connection with random digits,” Applied Math Series, Notes by G. E. Forsythe, in National Bureau of Standards, Vol. 12, pp. 36-38, 1951.
1var Extractors = require('randomness-extractors'); 2 3var source = [0, 0, 1, 0, 1, 1, 0, 1]; 4Extractors.vonNeumannsExtractor([source]); // '10'
Reference: https://people.eecs.berkeley.edu/~vazirani/pubs/2com.pdf
You could do inner product of the two sources in GF(2) to extract a random bit. Optionally, you could also perform the inner product in GF(2^n), 1 <= n <= 13, to obtain n random bits.
1var Extractors = require('randomness-extractors'); 2Extractors.innerProductExtractor([[0, 0, 0, 1, 1], [1, 1, 1, 1, 0]]) // '0'; 3 4var source1 = [0, 0, 1, 0, 1, 1, 0, 0]; 5var source2 = [1, 0, 1, 1, 0, 1, 1, 0]; 6 7var n = 3; // inner-product of GF(2^3) 8Extractors.innerProductExtractor([source1, source2], n) // '001'
You can get the extractors by including the dist/out.js
.
1... 2 3<script src="node_modules/randomness-extractors/dist/out.js"></script> 4<script> 5Extractors.innerProductExtractor([0, 0, 0, 1, 1], [1, 1, 1, 1, 0]) // '0'; 6</script> 7 8...
Or you could use browsify/webpack to require the package.
npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/21 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
38 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More