summaryrefslogtreecommitdiff
path: root/src/hash.cc
AgeCommit message (Collapse)Author
2024-02-06Use different hash algorithms for strings and file hashingMaxime Coste
For hash map, using fnv1a is faster as it is a much simpler algorithm we can afford to inline. For files murmur3 should win as it processes bytes 4 by 4.
2022-07-10Merge branch 'roam-murmurhash-endian' of http://github.com/ppentchev/kakouneMaxime Coste
2022-07-07murmurhash: always load byte by bytePeter Pentchev
Also reverse the order of bytes, loading the most significant parts first, and use bitwise "or" instead of addition.
2022-06-24Fix murmurhash for big-endian architectures.Peter Pentchev
The murmurhash implementation tries to read a sequence of four bytes as a single little-endian uint32 value. This does not work on e.g. Linux/s390x; https://buildd.debian.org/status/fetch.php?pkg=kakoune&arch=s390x&ver=2021.11.08-1&stamp=1645975425&raw=0
2021-05-28Support opening files bigger than 2 GiBMaxime Coste
The real technical limit is with lines bigger than 2 GiB and buffers with more than 2 Gi lines, refactor buffer loading to make it possible to load those files. Fix an overflow with the hash_data function at the same time
2021-04-18commentsBen Judd
2021-04-17hash unit tests.Ben Judd
2017-06-26Fix various undefined behaviours detected by UBSanMaxime Coste
2017-06-16Add fallthrough comment to silence gcc-7 warningMaxime Coste
Until we switch to C++17 and can use the proper attributes there. Fixes #1437
2014-12-16Rework hashing, use a more extensible framework similar to n3876 proposalMaxime Coste
std::hash specialization is a pain to work with, stop using that, and just specialize a 'size_t hash_value(const T&)' free function.