File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1444,6 +1444,20 @@ \section{Integer Division and Remainder}
14441444such that $ bc + d = a$ . Note that either of $ c$ or $ d$ can be set to \texttt {NULL } if their value
14451445is not required. If $ b$ is zero the function returns \texttt {MP\_ VAL }.
14461446
1447+ \section {Hashing }
1448+ To get a non-cryptographic hash of an \texttt {mp\_ int } use the following function.
1449+
1450+ \index {mp\_ hash}
1451+ \begin {alltt }
1452+ mp_err mp_hash (mp_int *a, mp_hval *hash);
1453+ \end {alltt }
1454+
1455+ This will create the hash of $ a$ following the \mbox {FNV-1a} algorithm as described on
1456+ \url {http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-1a}. With the
1457+ help of this function one can use an \texttt {mp\_ int } as a key in a hash table.
1458+
1459+ NB: The hashing is not stable over different widths of an \texttt {mp\_ digit }.
1460+
14471461\chapter {Multiplication and Squaring }
14481462\section {Multiplication }
14491463A full signed integer multiplication can be performed with the following.
You can’t perform that action at this time.
0 commit comments