Skip to main content

turbo_tasks_hash/
hex.rs

1/// Encodes a 64-bit unsigned integer into a hex string.
2pub fn encode_hex(n: u64) -> String {
3    format!("{:01$x}", n, std::mem::size_of::<u64>() * 2)
4}
5
6/// Encodes a 128-bit unsigned integer into a hex string.
7pub fn encode_hex_128(n: u128) -> String {
8    format!("{:01$x}", n, std::mem::size_of::<u128>() * 2)
9}