#
# Each concrete [hash.NAME] section must name its own hash function.
# The function is the defining identity of a hash domain and has no
-# default in [hash.*]. Supported values: crc64, cityhash, xxhash.
+# default in [hash.*]. Supported values: crc64, cityhash, xxhash, xxhash3.
# Other values (btrfs, crc32c, sha256, blake2) are reserved for
# future implementation.
#
case BeesHashFunction::crc64: return "crc64";
case BeesHashFunction::cityhash: return "cityhash";
case BeesHashFunction::xxhash: return "xxhash";
+ case BeesHashFunction::xxhash3: return "xxhash3";
}
return "unknown";
}();
case BeesHashFunction::xxhash:
h = XXH64(ptr, len, 0);
break;
+ case BeesHashFunction::xxhash3:
+ h = XXH3_64bits(ptr, len);
+ break;
}
// seed == 0 (enforced by bees_parse_hash_domains), so
// finalization is a no-op. The branch is present so the
if (val == "crc64") return BeesHashFunction::crc64;
if (val == "cityhash") return BeesHashFunction::cityhash;
if (val == "xxhash") return BeesHashFunction::xxhash;
- // Give a clear message for functions reserved for scan_next_extent.
+ if (val == "xxhash3") return BeesHashFunction::xxhash3;
+ // Give a clear message for functions reserved for future implementation.
if (val == "btrfs" || val == "crc32c" || val == "sha256" || val == "blake2") {
throw runtime_error(
"[hash." + name + "] function = '" + val +
);
}
throw runtime_error(
- "[hash." + name + "] function = " + val +
- " is unknown; supported values: crc64, cityhash, xxhash"
+ "[hash." + name + "] function = '" + val +
+ "' is unknown; supported values: crc64, cityhash, xxhash, xxhash3"
);
}
crc64, ///< CRC-64 (current default; backward-compatible with existing beeshash.dat)
cityhash, ///< CityHash64
xxhash, ///< XXHash64
+ xxhash3, ///< XXHash3 64-bit (faster than xxhash on modern hardware; incompatible with xxhash)
};
/// Immutable runtime object for one configured [hash.NAME] section.
/// - size must equal 4096
/// - seed must be 0
/// - insert must be true
-/// - function must be one of: crc64, cityhash, xxhash
+/// - function must be one of: crc64, cityhash, xxhash, xxhash3
/// - no duplicate section names
/// - at least one insert domain must exist
///