Skip to main content

cast_to_bytes

Function cast_to_bytes 

Source
fn cast_to_bytes(value: Num, n: usize) -> Num
Expand description

Casts a folded value to bytesN, keeping the value right-aligned in Num::Bytes.

bytesM(bytesN) keeps the leftmost min(M, N) bytes (and pads on the right when widening); casting an integer keeps its low N bytes.