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}
1444
1444
such that $ bc + d = a$ . Note that either of $ c$ or $ d$ can be set to \texttt {NULL } if their value
1445
1445
is not required. If $ b$ is zero the function returns \texttt {MP\_ VAL }.
1446
1446
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
+
1447
1461
\chapter {Multiplication and Squaring }
1448
1462
\section {Multiplication }
1449
1463
A full signed integer multiplication can be performed with the following.
You can’t perform that action at this time.
0 commit comments