Skip to content

Commit

Permalink
Delineate endian issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimes committed Sep 22, 2024
1 parent 8c0c520 commit 14edaed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ By default, `mmh3` returns **signed** values for the 32-bit and 64-bit versions
and **unsigned** values for `hash128` due to historical reasons. To get the
desired result, use the `signed` keyword argument.

Starting from version 4.0.0, `mmh3` returns the same values on big-endian
platforms as it does on little-endian ones, whereas the original C++ library is
Starting from version 4.0.0, **`mmh3` is endian-neutral**, meaning that its
hash functions return the same values on big-endian platforms as they do on
little-endian ones. In contrast, the original C++ library by Appleby is
endian-sensitive. If you need results that comply with the original library on
big-endian systems, please use version 3.\*.

Expand Down
7 changes: 7 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ functions particularly useful:
a `bytes` object, similar to the `hashlib` module in the Python Standard
Library. It performs faster than the 32-bit variant on 64-bit machines.

Note that **`mmh3` is endian-neutral**, while the original C++ library is
endian-sensitive (see also
[Known Issues](https://github.com/hajimes/mmh3#known-issues)).
This feature of `mmh3` is essential when portability across different
architectures is required, such as when calculating hash footprints for web
services.

## Basic Hash Functions

The following functions are used to hash immutable types, specifically
Expand Down

0 comments on commit 14edaed

Please sign in to comment.