Skip to content

Commit

Permalink
Add hash documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikwidlund committed Jan 19, 2017
1 parent d29e160 commit 33b3b82
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/apireference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,23 @@ For performance reasons some support callbacks need to be included in various ca

Clears the *map* of all the elements.

Hash
====

A few hash function are included in libdynamic.

.. function:: uint64_t hash_data(void *data, size_t size)

Returns a 64-bit hash of *size* bytes of memory pointed to by *data*. The library uses a `C port`_ of `Google Farmhash`_.

.. function:: uint64_t hash_string(char *string)

Returns a 64-bit hash of the null-terminated *string*.

.. _`Semantic Versioning`: http://semver.org/
.. _`C++ vector`: http://www.cplusplus.com/reference/vector/vector/
.. _`C++ string`: http://www.cplusplus.com/reference/string/string/
.. _`C++ unordered_map`: http://http://www.cplusplus.com/reference/unordered_map/unordered_map/

.. _`C port`: https://github.com/fredrikwidlund/cfarmhash
.. _`Google Farmhash`: https://github.com/google/farmhash

0 comments on commit 33b3b82

Please sign in to comment.