Skip to main content

u128_to_bytes

Function u128_to_bytes 

Source
pub fn u128_to_bytes(value: u128) -> [u8; 16]
Expand description

Converts a u128 value to bytes.

§Arguments

  • value - The u128 value to convert

§Returns

A 16-byte array in big-endian order.

§Example

use stealth_lib::encoding::hex_utils::u128_to_bytes;

let bytes = u128_to_bytes(0x0102030405060708090a0b0c0d0e0f10);
assert_eq!(bytes[0], 0x01);
assert_eq!(bytes[15], 0x10);