aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc/src/erl_nif.xml
diff options
context:
space:
mode:
authorGuilherme Andrade <[email protected]>2017-04-22 17:22:32 +0100
committerGuilherme Andrade <[email protected]>2017-04-22 17:25:13 +0100
commit21e1d879faaae2278a68200fe1085d7e73791fa0 (patch)
treec711ec5ac1659532787af3c0f44b764426fc88e5 /erts/doc/src/erl_nif.xml
parentd8756f8665a42effa2f3515369058cff4441abeb (diff)
downloadotp-21e1d879faaae2278a68200fe1085d7e73791fa0.tar.gz
otp-21e1d879faaae2278a68200fe1085d7e73791fa0.tar.bz2
otp-21e1d879faaae2278a68200fe1085d7e73791fa0.zip
erts: Support custom salt in enif_hash
Diffstat (limited to 'erts/doc/src/erl_nif.xml')
-rw-r--r--erts/doc/src/erl_nif.xml19
1 files changed, 12 insertions, 7 deletions
diff --git a/erts/doc/src/erl_nif.xml b/erts/doc/src/erl_nif.xml
index 53b6fdeaa1..03c96dd3ca 100644
--- a/erts/doc/src/erl_nif.xml
+++ b/erts/doc/src/erl_nif.xml
@@ -827,11 +827,13 @@ typedef enum {
</item>
<tag><c>ERL_NIF_PHASH2</c></tag>
<item>
- <p>Portable hash function that gives the same hash for the same Erlang term
- regardless of machine architecture and ERTS version. Corresponds to
- <seealso marker="erlang#phash2-1"><c>erlang:phash2/1</c></seealso>.</p>
- <p>Slower than <c>ERL_NIF_INTERNAL_HASH.</c></p>
+ <p>Portable hash function that gives the same hash for the
+ same Erlang term regardless of machine architecture and ERTS version.</p>
<p>Generated hash values within <c>0..2^27-1</c>.</p>
+ <p>Slower than <c>ERL_NIF_INTERNAL_HASH.</c>
+ When used with <c>salt=0</c>,
+ it corresponds to
+ <seealso marker="erlang#phash2-1"><c>erlang:phash2/1</c></seealso>.</p>
</item>
</taglist>
</item>
@@ -1411,12 +1413,15 @@ typedef enum {
<func>
<name>
<ret>unsigned long</ret>
- <nametext>enif_hash(ErlNifHash type, ERL_NIF_TERM term)</nametext>
+ <nametext>
+ enif_hash(ErlNifHash type, ERL_NIF_TERM term, unsigned long salt)
+ </nametext>
</name>
<fsummary>Hash terms.</fsummary>
<desc>
- <p>Hash terms according to the specified
- <seealso marker="#ErlNifHash"><c>ErlNifHash</c></seealso> type.</p>
+ <p>Hash <c>term</c> according to the specified
+ <seealso marker="#ErlNifHash"><c>ErlNifHash</c></seealso> <c>type</c>
+ and using the least significant 32 bits of <c>salt</c>.</p>
<p>Range of returned value depends on the hash type.</p>
</desc>
</func>