Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern crate rand_core;
- extern crate rand_pcg;
- #[macro_use]
- extern crate lazy_static;
- use rand_pcg::Pcg32 as Rng;
- use rand_core::{SeedableRng, RngCore};
- use std::sync::Mutex;
- lazy_static! {
- static ref rng: Mutex<Rng> = Mutex::new(Rng::seed_from_u64(0));
- }
- #[no_mangle]
- pub extern fn call_pcg32() -> u32 {
- rng.lock().unwrap().next_u32()
- }
Add Comment
Please, Sign In to add comment