Skip to content
This repository has been archived by the owner on Oct 7, 2022. It is now read-only.
/ rust-rand-facade Public archive

A WIP global facade for rand::RngCore to support library-agnostic use

Notifications You must be signed in to change notification settings

ryankurte/rust-rand-facade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rand-facade

An experimental global facade for rand::RngCore to support use of initialised random number generators in no_std capable libraries and projects, without needing to specify a given random generator within the library.

This allows you to initialise and maintain a physical Random Number Generator (RNG) on no_std platforms, while allowing the sharing a global RNG (if required) or falling through to the default OsRng on std platforms.

This is intended to be used as a dependency for relevant libraries / projects that require RNGs, and allows modes to be swapped using the feature flags described below.

Usage

Include by adding rand-facade = "0.1.0" to your Cargo.toml.

Features

  • os_rng disables binding and falls through to the default rand::rng::OsRng, this is a sensible default for most apps
  • std enables global Rng binding using std::sync::Mutex
  • cortex_m enables global Rng binding using cortex_m::Mutex

Status

This is a work in progress! Currently this works with std and cortex-m platforms.

GitHub tag Build Status Crates.io Docs.rs

Open Issues

About

A WIP global facade for rand::RngCore to support library-agnostic use

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages