In rust, make the shortest coffee possible, the objective is to get the sha256 of a…
- User
In rust, make the shortest coffee possible, the objective is to get the sha256 of a random float
Assistant
Shortest Coffee in Rust
Below is a concise Rust program that generates a random float, computes its SHA256 hash, and prints the result.
rustuse rand::Rng; use sha2::{Sha256, Digest}; use hex; fn main() { let mut rng = rand::thread_rng(); let random_float: f64 = rng.gen(); let mut hasher = Sha256::new(); hasher.update(random_float.to_le_bytes()); println!("{}", hex::encode(hasher.finalize())); }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.