Checksums and non-cryptographic hashes

Metrohash

J. Andrew Rogers's fast 64-bit non-cryptographic hash generated by algorithm search

unverified Root API only Not cryptographic
Unverified tier.

Source found and wired, correctness not fully proven. Root API only. Reach it with NextSSL(root=True) in Python or the nextssl_root_* functions in C.

About Metrohash

Metrohash is a checksum / non-cryptographic hash. It produces an 8-byte (64-bit) output. Its registry entry cites MetroHash64 (J. Andrew Rogers), NON-cryptographic. NextSSL lists it in the unverified tier and exposes it through the root API only (NextSSL(root=True) in Python, nextssl_root_* in C).

Overview

MetroHash is a family of non-cryptographic hash functions by J. Andrew Rogers, released in 2015. Its constants and operation sequence were found by an automated search for fast functions that pass statistical quality tests. It provides no security against a deliberate attacker.

MetroHash64 processes 32-byte blocks using four 64-bit lanes, each updated by multiplying input words by constants, adding and rotating. The lanes are combined and a final avalanche of multiply and rotate steps produces a 64-bit result. Variants with 128-bit output also exist. It is optimised for x86-64. It is compact.

NextSSL includes MetroHash64 wired from source and not yet verified. Different MetroHash variants use different constants and are not interchangeable, so stored values must record which one was used. None of this provides security: the function has no secret key, and anyone can compute or deliberately collide its outputs. Use a seed.

History

2015–2015
  1. MetroHash published by J. Andrew Rogers

Security notes

MetroHash is not cryptographic and offers no resistance to deliberate collision finding.

Typical uses

Hash tables with trusted keysFast data fingerprinting

Sizes

FieldBytesMeaning
out8Output

Use it

from nextssl_demo import NextSSL

root = NextSSL(root=True)   # tier 'unverified' is reachable from the root API only
value = root.call("checksum", "metrohash", None, b"123456789")[0]

Calls follow the NextSSL C ABI and its language bindings. Buffer sizes are validated against the sizes above.

Frequently asked questions

What is Metrohash?

Metrohash is a checksum in the MetroHash family. MetroHash is a family of non-cryptographic hash functions by J. Andrew Rogers, released in 2015.

What are the Metrohash sizes?

In NextSSL, Metrohash uses: output 8 bytes.

Who designed Metrohash and when?

Metrohash belongs to the MetroHash family, first published in 2015 by J. Andrew Rogers.

Which standards define Metrohash?

Metrohash is referenced by MetroHash64 (J. Andrew Rogers), NON-cryptographic.

Is Metrohash safe to use?

Metrohash is in the unverified tier. Source found and wired, correctness not fully proven. Root API only. It is only reachable through the root API (NextSSL(root=True) in Python, nextssl_root_* in C).