LIBKECCAK_BEHEX_UPPER(3)
π 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 π
libkeccak_behex_lower(3)β the lowercase siblinglibkeccak_unhex(3)β for going the other direction
ngl, the only way to mess this up is to under-allocateoutput.(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
- arch rolling: libkeccak 1.4.3-1 Β· custom:ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- opensuse-leap 16.0: libkeccak-devel 1.4-bp160.1.13 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms