VariantKey  5.4.1
Numerical Encoding for Human Genetic Variants
hex.h File Reference

Utility functions to manipulate strings. More...

#include <inttypes.h>
#include <stdio.h>

Go to the source code of this file.

Functions

static size_t hex_uint64_t (uint64_t n, char *str)
 Returns uint64_t hexadecimal string (16 characters). More...
 
static uint64_t parse_hex_uint64_t (const char *s)
 Parses a 16 chars hexadecimal string and returns the code. More...
 

Detailed Description

Collection of utility functions to manipulate strings.

Function Documentation

static size_t hex_uint64_t ( uint64_t  n,
char *  str 
)
inlinestatic
Parameters
nNumber to parse
strString buffer to be returned (it must be sized 17 bytes at least).
Returns
Upon successful return, these function returns the number of characters processed (excluding the null byte used to end output to strings). If the buffer size is not sufficient, then the return value is the number of characters required for buffer string, including the terminating null byte.
static uint64_t parse_hex_uint64_t ( const char *  s)
inlinestatic
Parameters
sHexadecimal string to parse (it must contain 16 hexadecimal characters).
Returns
uint64_t unsigned integer number.