MDEX_TREE_HASH(3)

πŸ’– MDEX_TREE_HASH πŸ’–

okay bestie, gather round, we're doing a Librecast Programmer's Manual moment β€” this is mdex_tree_hash(3), and it's giving "let me get a hash of your merkle tree root real quick" energy. πŸŽ€


✨ NAME ✨

mdex_tree_hash β€” create hash of merkle tree root 🌳


πŸ“š LIBRARY πŸ“š

Librecast library (liblibrecast, -llibrecast)


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <librecast/mdex.h>

int mdex_tree_hash(unsigned char *hash, size_t hashlen, mtree_t *mtree, size_t n);

Compile and link with -llibrecast.


🌸 DESCRIPTION 🌸

so like, the mdex_tree_hash function literally creates a hash of length hashlen from the root node of mtree with key n. πŸ’…

and bestie, what's it for? two things, no cap:

  • it's used to index an mtree in several parts πŸ”₯
  • and it distinguishes the root node from the first data node when nodes = 1 πŸ‘‘

that's it. that's the vibe. simple, iconic, does exactly what it says. ✨


🫢 RETURN VALUE 🫢

  • success β€” mdex_tree_hash() returns zero. slay. πŸ’š
  • error β€” -1 is returned. 😭

πŸ‘€ SEE ALSO πŸ‘€


k that's the whole page, bestie πŸ’œ this was LIBRECAST, dated 2023-07-23, and it's the MDEX_TREE_HASH(3) era β€” go forth and hash those merkle roots, ily, mwah πŸ§šπŸ’–

πŸ“¦ where this page comes from