Function nativeTo [src]
Converts an integer which has host endianness to the desired endianness.
Prototype
pub fn nativeTo(comptime T: type, x: T, desired_endianness: Endian) T
Parameters
T: type
x: T
desired_endianness: Endian
Source
pub fn nativeTo(comptime T: type, x: T, desired_endianness: Endian) T {
return switch (desired_endianness) {
.little => nativeToLittle(T, x),
.big => nativeToBig(T, x),
};
}