IntFromBytesBE
IntFromBytesBE
Description
Create an integer from big-endian bytes.
Parameters
| Name | Direction | Description |
|---|---|---|
bytes |
in | Source byte buffer |
len |
in | Number of bytes to read |
Usage example (from documentation)
Int value = IntFromBytesBE(buffer, buffer_len);Returns
Integer decoded from the byte sequence.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:429:
}
Int IntFromBytesBE(const u8 *bytes, u64 len) {
if (!bytes && len != 0) {
LOG_FATAL("bytes is NULL");- In
Int.Convert.c:74:
u8 bytes[] = {0x12, 0x34, 0x56, 0x78};
u8 out[4] = {0};
Int value = IntFromBytesBE(bytes, sizeof(bytes));
u64 written = IntToBytesBE(&value, out, sizeof(out));
Str text = IntToHexStr(&value);
Last updated on