fn crypto_fixed_hex32(buffer: MutSpan, value: u32) -> Maybe> { if std.mem.len(buffer) < 8 { return null } var place: u32 = 268435456_u32 var index: usize = 0 while index < 8 { let digit: u8 = ((value / place) % 16_u32) as u8 if digit < 10_u8 { buffer[index] = 48_u8 + digit } else { buffer[index] = 87_u8 + digit } place = place / 16_u32 index = index + 1 } return buffer[..8] } fn crypto_hash_hex32(buffer: MutSpan, bytes: Span) -> Maybe> { return crypto_fixed_hex32(buffer, std.crypto.hash32(bytes)) } fn crypto_hmac_hex32(buffer: MutSpan, key: Span, bytes: Span) -> Maybe> { return crypto_fixed_hex32(buffer, std.crypto.hmac32(key, bytes)) } fn crypto_stable_id32(buffer: MutSpan, bytes: Span) -> Maybe> { return crypto_fixed_hex32(buffer, std.crypto.hash32(bytes)) } fn crypto_random_id32(buffer: MutSpan) -> Maybe> { return crypto_fixed_hex32(buffer, std.crypto.secureRandomU32()) }