UNPKG

randomcryp

Version:

A cryptographically secure, feature rich, zero dependency and browser friendly random number generator library.

7 lines (6 loc) 284 B
/** * Generates `true` with the probability of the percentage value given. * @example percentage(20) // should return true 20% of the time and false 80% of the time. * @throws RangeError if `p` is not range `[0, 100]`. **/ export declare const percentage: (p: number) => boolean;