LIBKECCAK_UNHEX(3)

πŸ“¦ version 1.4.3, in arch rolling, opensuse-leap 16.0

πŸ’… NAME πŸ’…

Okay so bestie, welcome to LIBKECCAK_UNHEX(3), from the Library Functions Manual β€” yes, the manual name is literally right there, cute. ✨ The main character is libkeccak_unhex, and her whole thing is this: converts a hexadecimal hashsum to binary. No cap. πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <libkeccak.h>

void libkeccak_unhex(void *restrict output, const char *restrict hashsum);

Link with -lkeccak. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

So libkeccak_unhex() takes the hexadecimal hashsum that's chilling in hashsum, converts it to binary, and drops the binary representation into output. Iconic behavior, honestly. πŸ’…

hashsum has to be terminated by a NUL-character. It can be lowercase, uppercase, or a mix of both β€” she's flexible like that. 🌈

🚨 output will not be terminated. Important, bestie. Do not expect a cute lil' NUL at the end. 😭

(strlen(hashsum) / 2) bytes will be written to the beginning of Ioutput β€” yep, the page literally says Ioutput, so that's the output pointer having a tiny typo moment πŸ’€. Because of that, output should have an allocation of at least that number of bytes. Don't skimp on the buffer, fr fr. πŸ“


🌟 RETURN VALUES 🌟

libkeccak_unhex() does return any value. That's what the page says β€” and the synopsis is all void, so it's giving β€œno value returned” energy. The original wording is a little quirky, but we're keeping it. πŸ’…


πŸ”₯ ERRORS πŸ”₯

libkeccak_unhex() cannot fail. Periodt. πŸ’…βœ¨


πŸ‘‘ NOTES πŸ‘‘

hashsum must have an even number of digits β€” and that's characters excluding the terminating NUL-character, bestie. Even digits only. No odd-numbered chaos allowed. 🌸


🫢 SEE ALSO 🫢


Cute little footer sign-off: source/version LIBKECCAK, page LIBKECCAK_UNHEX(3) β€” and there's no date in the footer, so no invented date, just vibes. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from