{"id":13484718,"url":"https://github.com/rust-random/rand","last_synced_at":"2026-02-14T09:09:07.626Z","repository":{"id":26769771,"uuid":"30227790","full_name":"rust-random/rand","owner":"rust-random","description":"A Rust library for random number generation.","archived":false,"fork":false,"pushed_at":"2025-04-25T07:38:27.000Z","size":5039,"stargazers_count":1827,"open_issues_count":24,"forks_count":461,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-05-05T21:09:41.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://crates.io/crates/rand","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-random.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"dhardy"}},"created_at":"2015-02-03T05:59:32.000Z","updated_at":"2025-05-04T06:11:42.000Z","dependencies_parsed_at":"2024-06-18T11:13:17.171Z","dependency_job_id":"3e9fcad3-7361-4854-833a-47308665611a","html_url":"https://github.com/rust-random/rand","commit_stats":{"total_commits":2616,"total_committers":289,"mean_commits":9.051903114186851,"dds":0.7377675840978593,"last_synced_commit":"9f05e22afb6031d32f36cd927592e7e49b668d64"},"previous_names":["rust-lang/rand"],"tags_count":161,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-random%2Frand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-random%2Frand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-random%2Frand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-random%2Frand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-random","download_url":"https://codeload.github.com/rust-random/rand/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577020,"owners_count":21770721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:01:31.396Z","updated_at":"2026-02-14T09:09:07.620Z","avatar_url":"https://github.com/rust-random.png","language":"Rust","funding_links":["https://github.com/sponsors/dhardy"],"categories":["Rust","Rust Libraries","Libraries","Cryptography","Other"],"sub_categories":["Cryptography","Rseudo Random Number Generator"],"readme":"# Rand\n\n[![Test Status](https://github.com/rust-random/rand/actions/workflows/test.yml/badge.svg?event=push)](https://github.com/rust-random/rand/actions)\n[![Crate](https://img.shields.io/crates/v/rand.svg)](https://crates.io/crates/rand)\n[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/)\n[![API](https://docs.rs/rand/badge.svg)](https://docs.rs/rand)\n\nRand is a set of crates supporting (pseudo-)random generators:\n\n-   Built over a standard RNG trait: [`rand_core::RngCore`](https://docs.rs/rand_core/latest/rand_core/trait.RngCore.html)\n-   With fast implementations of both [strong](https://rust-random.github.io/book/guide-rngs.html#cryptographically-secure-pseudo-random-number-generators-csprngs) and\n    [small](https://rust-random.github.io/book/guide-rngs.html#basic-pseudo-random-number-generators-prngs) generators: [`rand::rngs`](https://docs.rs/rand/latest/rand/rngs/index.html), and more RNGs: [`rand_chacha`](https://docs.rs/rand_chacha), [`rand_xoshiro`](https://docs.rs/rand_xoshiro/), [`rand_pcg`](https://docs.rs/rand_pcg/), [rngs repo](https://github.com/rust-random/rngs/)\n-   [`rand::rng`](https://docs.rs/rand/latest/rand/fn.rng.html) is an asymptotically-fast, automatically-seeded and reasonably strong generator available on all `std` targets\n-   Direct support for seeding generators from the [getrandom] crate\n\nWith broad support for random value generation and random processes:\n\n-   [`StandardUniform`](https://docs.rs/rand/latest/rand/distr/struct.StandardUniform.html) random value sampling,\n    [`Uniform`](https://docs.rs/rand/latest/rand/distr/struct.Uniform.html)-ranged value sampling\n    and [more](https://docs.rs/rand/latest/rand/distr/index.html)\n-   Samplers for a large number of non-uniform random number distributions via our own\n    [`rand_distr`](https://docs.rs/rand_distr) and via\n    the [`statrs`](https://docs.rs/statrs)\n-   Random processes (mostly choose and shuffle) via [`rand::seq`](https://docs.rs/rand/latest/rand/seq/index.html) traits\n\nAll with:\n\n-   [Portably reproducible output](https://rust-random.github.io/book/portability.html)\n-   `#[no_std]` compatibility (partial)\n-   *Many* performance optimisations thanks to contributions from the wide\n    user-base\n\nRand **is not**:\n\n-   Small (LoC). Most low-level crates are small, but the higher-level `rand`\n    and `rand_distr` each contain a lot of functionality.\n-   Simple (implementation). We have a strong focus on correctness, speed and flexibility, but\n    not simplicity. If you prefer a small-and-simple library, there are\n    alternatives including [fastrand](https://crates.io/crates/fastrand)\n    and [oorandom](https://crates.io/crates/oorandom).\n-   Primarily a cryptographic library. `rand` does provide some generators which\n    aim to support unpredictable value generation under certain constraints;\n    see [SECURITY.md](https://github.com/rust-random/rand/blob/master/SECURITY.md) for details.\n    Users are expected to determine for themselves\n    whether `rand`'s functionality meets their own security requirements.\n\nDocumentation:\n\n-   [The Rust Rand Book](https://rust-random.github.io/book)\n-   [API reference (docs.rs)](https://docs.rs/rand)\n\n\n## Versions\n\nRand is *mature* (suitable for general usage, with infrequent breaking releases\nwhich minimise breakage) but not yet at 1.0. Current `MAJOR.MINOR` versions are:\n\n-   Version 0.9 was released in January 2025.\n\nSee the [CHANGELOG](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) or [Upgrade Guide](https://rust-random.github.io/book/update.html) for more details.\n\n## Crate Features\n\nRand is built with these features enabled by default:\n\n-   `std` enables functionality dependent on the `std` lib\n-   `alloc` (implied by `std`) enables functionality requiring an allocator\n-   `sys_rng` (implied by `std`) enables `rngs::SysRng`, using the [getrandom] crate\n-   `std_rng` enables inclusion of `StdRng`, `ThreadRng`\n-   `small_rng` enables inclusion of the `SmallRng` PRNG\n\nOptionally, the following dependencies can be enabled:\n\n-   `log` enables logging via [log](https://crates.io/crates/log)\n\nAdditionally, these features configure Rand:\n\n-   `nightly` includes some additions requiring nightly Rust\n-   `simd_support` (experimental) enables sampling of SIMD values\n    (uniformly random SIMD integers and floats), requiring nightly Rust\n-   `unbiased` use unbiased sampling for algorithms supporting this option: Uniform distribution.\n\n    (By default, bias affecting no more than one in  2^48 samples is accepted.)\n\n    Note: enabling this option is expected to affect reproducibility of results.\n\nNote that nightly features are not stable and therefore not all library and\ncompiler versions will be compatible. This is especially true of Rand's\nexperimental `simd_support` feature.\n\nRand supports limited functionality in `no_std` mode (enabled via\n`default-features = false`). In this case, `SysRng` is\nunavailable (unless `sys_rng` is enabled), large parts of `seq` are\nunavailable (unless `alloc` is enabled), and `ThreadRng` is unavailable.\n\n## Portability and platform support\n\nMany (but not all) algorithms are intended to have reproducible output. Read more in the book: [Portability](https://rust-random.github.io/book/portability.html).\n\nThe Rand library supports a variety of CPU architectures. Platform integration is outsourced to [getrandom].\n\n### WebAssembly support\n\nThe [WASI](https://github.com/WebAssembly/WASI/tree/main) and Emscripten\ntargets are directly supported. The `wasm32-unknown-unknown` target is not\n*automatically* supported. To enable support for this target, refer to the\n[`getrandom` documentation for WebAssembly](https://docs.rs/getrandom/latest/getrandom/#webassembly-support).\nAlternatively, the `sys_rng` feature may be disabled.\n\n# License\n\nRand is distributed under the terms of both the MIT license and the\nApache License (Version 2.0).\n\nSee [LICENSE-APACHE](https://github.com/rust-random/rand/blob/master/LICENSE-APACHE) and [LICENSE-MIT](https://github.com/rust-random/rand/blob/master/LICENSE-MIT), and\n[COPYRIGHT](https://github.com/rust-random/rand/blob/master/COPYRIGHT) for details.\n\n[getrandom]: https://crates.io/crates/getrandom\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-random%2Frand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-random%2Frand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-random%2Frand/lists"}