core/basics/basics library

Enums

Casing

Functions

boolean() bool
It returns a random boolean value.
character({bool? alpha, String? pool, bool? numeric, Casing? casing, bool? symbols}) String
Return a random character. Usage character() character({ pool: 'abcde' }) chance.character({ alpha: true }) chance.character({ numeric: true }) chance.character({ casing: 'lower' }) chance.character({ symbols: true })
falsy({Set? pool}) → dynamic
Return a random falsy value (false, null, 0, ''). usages falsy() falsy({ pool: {null, '', 0} })
floating({int? fixed, num? min, num? max}) double
It returns a random double point number between min and max
integer({int? min, int? max}) int
This function returns a random integer between min value and max value. If no argument if passed, it will generate random integers between 0 and 1,000,000,000.
letter({Casing? casing}) String
a function that returns a random letter.
natural({int? max}) int
Generate a random number between 0 and 1,000,000,000 (or a max value if provided).
prime({int? max}) int
Return a random prime number, optionally between 1 and max.
string({int length = 5, int? max, String? pool, bool? alpha, Casing? casing, bool? symbols}) String
It generates a random string of characters from a given string of characters
template(String temp) String
It takes a string and replaces all the 'a' characters with a random lowercase letter, all the 'A' characters with a random uppercase letter, and all the '#' characters with a random number