LIBKECCAK_BEHEX_UPPER(3)

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

πŸ’… LIBKECCAK_BEHEX_UPPER β€” bestie, let's talk hex

okay so real quick: this is a page from the libkeccak manual set (yep, the LIBKECCAK_BEHEX_UPPER(3) one, section 3, library functions manual, iykyk) and it's literally the cutest tiny function ever. it takes your binary hashsum and turns it into ✨UPPERCASE HEX✨. that's it. that's the whole vibe.


🌸 NAME 🌸

libkeccak_behex_upper β€” converts a binary hashsum to upper case hexadecimal πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <libkeccak.h>

void libkeccak_behex_upper(char *restrict output, const void *restrict hashsum, size_t n);

Link with -lkeccak. don't forget it bestie, the linker will NOT be forgiving 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so the libkeccak_behex_upper() function takes a binary hashsum (that's the one chillin' in hashsum, bestie) and converts it to uppercase hexadecimal, then drops the hexadecimal representation into output. she's serving ABCDEF realness, not abcdef. πŸ’…

output gets terminated by a NUL-character. so like, it's a proper C string, no cap.

the n parameter tells you how many bytes the binary hashsum is made of. and listen β€” this part matters β€” output needs an allocation size of (2 * n + 1). two chars per byte plus one for the NUL. do the math, don't get caught slippin' 😭


⭐ RETURN VALUES ⭐

the libkeccak_behex_upper() function does not return any value. it's void, she's a void girlie, she just does the thing and leaves πŸ‘‘


πŸ”₯ ERRORS πŸ”₯

the libkeccak_behex_upper() function cannot fail. not a single error case. flawless behaviour, main character energy, periodt. πŸ’€


🌈 SEE ALSO 🌈


ngl, the only way to mess this up is to under-allocate output. (2 * n + 1) β€” write it down, tattoo it on your arm, whatever works πŸŽ€

okay that's the whole page bestie, no notes. brought to you by LIBKECCAK (the LIBKECCAK_BEHEX_UPPER(3) page, library functions manual, section 3) β€” go convert some hashsums and slay πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from