Browse Source Download (without any required ccan dependencies)

Module:

str/hex

Summary:

hex-to-string conversions and vice-versa

Author:

Rusty Russell <[email protected]>

Description:

This code contains simple routines for hexadecimal strings.

Example:

int main(int argc, char *argv[])
{
        int i;

        for (i = 1; i < argc; i++) {
                char str[hex_str_size(strlen(argv[i]))];

                hex_encode(str, sizeof(str), argv[i], strlen(argv[i]));
                printf("%s ", str);
        }
        printf("\n");
        return 0;
}

License:

CC0 (Public domain)