MCPcopy Create free account
hub / github.com/apache/paimon-rust / rand_f64

Function rand_f64

crates/paimon/src/table/table_commit.rs:1084–1095  ·  view source on GitHub ↗

Random f64 in [0, 1) using RandomState for per-process entropy.

()

Source from the content-addressed store, hash-verified

1082
1083/// Random f64 in [0, 1) using RandomState for per-process entropy.
1084fn rand_f64() -> f64 {
1085 use std::collections::hash_map::RandomState;
1086 use std::hash::{BuildHasher, Hasher};
1087 let mut hasher = RandomState::new().build_hasher();
1088 hasher.write_u64(
1089 SystemTime::now()
1090 .duration_since(UNIX_EPOCH)
1091 .unwrap_or_default()
1092 .as_nanos() as u64,
1093 );
1094 (hasher.finish() as f64) / (u64::MAX as f64)
1095}
1096
1097#[cfg(test)]
1098mod tests {

Callers 1

commit_retry_waitMethod · 0.85

Calls 1

finishMethod · 0.45

Tested by

no test coverage detected