Browse Source Download (without any required ccan dependencies)

Module:

str/hex

Summary:

hex-to-string conversions and vice-versa

Author:

Rusty Russell <rusty@rustcorp.com.au>

Description:

This code contains simple routines for hexidecimal 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)