Gathering detailed insights and metrics for extra-rand
Gathering detailed insights and metrics for extra-rand
Gathering detailed insights and metrics for extra-rand
Gathering detailed insights and metrics for extra-rand
random-extra
Seedable random number generator supporting many common distributions.
extra-random
A random number is a number, chosen as if by chance from a set.
randomness-extractors
Extract (hopefully) almost uniform random bit from source(s) of biased and correlated bits.
puppeteer-extra-plugin-randomize-ua
Randomize User-Agent in puppeteer.
npm install extra-rand
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (98.77%)
JavaScript (1.23%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
1 Stars
72 Commits
2 Watchers
1 Branches
1 Contributors
Updated on May 14, 2025
Latest Version
0.4.1
Package Id
extra-rand@0.4.1
Unpacked Size
35.32 kB
Size
7.03 kB
File Count
55
NPM Version
10.2.3
Node Version
18.19.0
Published on
Sep 14, 2024
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
Yet another random library.
1npm install --save extra-rand 2# or 3yarn add extra-rand
1interface IRandomNumberGenerator { 2 next(): number // [0, 1) 3}
1function randomFloat(min: number, max: number): number
2function randomFloat(generator: IRandomNumberGenerator, min: number, max: number): number
The function returns a float in the range [min, max)
.
1function randomInt(min: number, max: number): number
2function randomInt(generator: IRandomNumberGenerator, min: number, max: number): number
The function returns an integer in the range [Math.ceil(min), Math.floor(max))
.
1function randomIntInclusive(min: number, max: number): number
2function randomIntInclusive(
3 generator: IRandomNumberGenerator
4, min: number
5, max: number
6): number
The function returns an integer in the range [Math.ceil(min), Math.floor(max)]
.
1enum NumberType { 2 Float 3, Integer 4, IntegerInclusive 5} 6 7type INumberModel = 8| number 9| Getter<number> 10| { 11 type: NumberType 12 min: number 13 max: number 14 } 15| NonEmptyArray<{ 16 weight: number 17 model: INumberModel 18 }> 19 20function randomNumber(model: INumberModel): number 21function randomNumber(generator: IRandomNumberGenerator, model: INumberModel): number
1function randomBool(probabilityOfTrue: number): boolean
2function randomBool(generator: IRandomNumberGenerator, probabilityOfTrue: number): boolean
1function randomPickItem<T>(items: NonEmptyArray<T>): T 2function randomPickItem<T>( 3 generator: IRandomNumberGenerator 4, items: NonEmptyArray<T> 5): T
1interface IWeightedItem { 2 weight: number 3} 4 5function randomPickWeightedItem<T>(items: NonEmptyArray<T>, weights: NonEmptyArray<number>): T 6function randomPickWeightedItem<T extends IWeightedItem>(items: NonEmptyArray<T>): T 7function randomPickWeightedItem<T>( 8 generator: IRandomNumberGenerator 9, items: NonEmptyArray<T> 10, weights: NonEmptyArray<number> 11): T 12function randomPickWeightedItem<T extends IWeightedItem>( 13 generator: IRandomNumberGenerator 14, items: NonEmptyArray<T> 15): T
1function randomPickIndex(items: NonEmptyArray<unknown>): number
2function randomPickIndex(
3 generator: IRandomNumberGenerator
4, items: NonEmptyArray<unknown>
5): number
The function returns an integer in the range [0, items.length]
.
1function randomPickWeightedIndex(weights: NonEmptyArray<number>): number
2function randomPickWeightedIndex(
3 generator: IRandomNumberGenerator
4, weights: NonEmptyArray<number>
5): number
The function returns an integer in the range [0, weights.length]
.
1function shuffle(arr: unknown[]): void 2function shuffle(generator: IRandomNumberGenerator, arr: unknown[]): void
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
branch protection not enabled on development/release branches
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
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