Crates.io | valve-sdk13-rng |
lib.rs | valve-sdk13-rng |
version | 0.1.0 |
source | src |
created_at | 2021-09-27 00:30:38.979851 |
updated_at | 2021-09-27 00:30:38.979851 |
description | A port of Valve's SDK13 Uniform random number generator in Rust. |
homepage | |
repository | https://github.com/saskenuba/SteamHelper-rs/tree/master/crates/valve-sdk13-rng |
max_upload_size | |
id | 456724 |
size | 6,390 |
This is a direct translation to Rust of the original Source 2013 SDK Uniform Random Number Generator from Valve, ported to golang by @Step7750
Thanks Step7750 for taking the time to reverse engineer it, and taking the time of how skins work outside of the game.
use valve_sdk13_rng::UniformRandomStream;
let mut gen = UniformRandomStream::with_seed(72);
let res = gen.random_f64(0_f64, 1_f64);
assert_eq!(0.543_099_8, res);