strip.h (795B)
1 #ifndef LASH_BYTES_H_ 2 #define LASH_BYTES_H_ 3 4 /** 5 * strip zero value zeros from a big-endian integer array 6 * 7 * \param value integer data to strip zeros from. 8 * \parmm len pointer to length of input integer data. Length of stripped integer will be written here. 9 * \return pointer to position in buffer containing the stripped integer data. 10 * 11 */ 12 char* strip_be(char *value, size_t *len); 13 /** 14 * expand a truncated signed big-endian integer to full bitsize 15 * 16 * \param in integer data to expand. 17 * \param in_len length of input integer. 18 * \param out output buffer where expanded integer will be written. 19 * \param out_len output buffer capacity. 20 * \return 0 if successfully written, 1 on any failure. 21 * 22 */ 23 int strap_be(const char *in, size_t in_len, char *out, size_t out_len); 24 25 #endif