1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
.TH MDEX_TREE_HASH 3 2023-07-23 "LIBRECAST" "Librecast Programmer's Manual"
.SH NAME
mdex_tree_hash \- create hash of merkle tree root
.SH LIBRARY
Librecast library
.RI ( liblibrecast ", " \-llibrecast )
.SH SYNOPSIS
.nf
.B #include <librecast/mdex.h>
.PP
.BI "int mdex_tree_hash(unsigned char " *hash ", size_t " hashlen ", mtree_t " *mtree ", size_t " n ");"
.fi
.PP
Compile and link with \fI\-llibrecast\fP.
.SH DESCRIPTION
The
.BR mdex_tree_hash
function creates a
.IR hash
of length
.IR hashlen
from the root node of
.IR mtree
with key
.IR n .
This is used to index an mtree in several parts, and to distinguish the root node from the first data node when nodes = 1.
.PP
.SH RETURN VALUE
The
.BR mdex_tree_hash ()
returns zero on success.
On error, \-1 is returned.
.PP
.SH SEE ALSO
.BR hash_generic_key (3),
.BR mdex_init (3),
.BR mdex_free (3),
.BR mdex_get (3),
.BR mdex_put (3),
.BR mdex_del (3),
.BR lc_share (3)
|