File lt_utils.h
FileList > api > lt_utils.h
Go to the source code of this file.
#include <libretiny.h>
Public Functions
Type | Name |
---|---|
void | hexdump (const uint8_t * buf, size_t len, uint32_t offset=0, uint8_t width=16) Print data pointed to by buf in hexdump-like format (hex+ASCII). |
char * | lt_btox (const uint8_t * src, int len, char * dest) Convert a byte array to hexadecimal string. |
void | lt_rand_bytes (uint8_t * buf, size_t len) Generate random bytes using rand(). |
uint8_t * | lt_xtob (const char * src, int len, uint8_t * dest) Convert a hexadecimal string to byte array. |
Macros
Type | Name |
---|---|
define | MAX (a, b) |
define | MIN (a, b) |
Public Functions Documentation
function hexdump
Print data pointed to by buf in hexdump-like format (hex+ASCII).
Parameters:
buf
source pointerlen
how many bytes to printoffset
increment printed offset by this valuewidth
how many bytes on a line
function lt_btox
Convert a byte array to hexadecimal string.
Parameters:
src
source byte arraylen
source length (bytes)dest
destination string
Returns:
destination string
function lt_rand_bytes
Generate random bytes using rand().
Parameters:
buf
destination pointerlen
how many bytes to generate
function lt_xtob
Convert a hexadecimal string to byte array.
Parameters:
src
source stringlen
source length (chars)dest
destination byte array
Returns:
destination byte array
Macro Definition Documentation
define MAX
#define MAX (
a,
b
) ({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a > _b ? _a : _b; \
})
define MIN
#define MIN (
a,
b
) ({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a < _b ? _a : _b; \
})
The documentation for this class was generated from the following file cores/common/base/api/lt_utils.h