(vec: Vec<f32>)
| 357 | |
| 358 | #[allow(dead_code)] |
| 359 | pub fn hash_float_vec(vec: Vec<f32>) -> Vec<u8> { |
| 360 | // Create a new hasher instance |
| 361 | let mut hasher = Sha256::new(); |
| 362 | |
| 363 | // Convert the Vec<f32> to a byte representation |
| 364 | for &num in &vec { |
| 365 | // Convert each f32 to its byte representation and update the hasher |
| 366 | hasher.update(num.to_le_bytes()); |
| 367 | } |
| 368 | |
| 369 | // Finalize the hash and return the result as a Vec<u8> |
| 370 | hasher.finalize().to_vec() |
| 371 | } |
| 372 | |
| 373 | pub fn get_max_insert_level(x: f64, levels: &[(f64, u8)]) -> u8 { |
| 374 | let lst = levels.iter(); |
nothing calls this directly
no outgoing calls
no test coverage detected