---
source: https://iinventedlight.com/library/notes/go-maphash.md
title: "Go hash/maphash: hash functions for hash tables"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (The Go Authors); BSD-3-Clause (The Go Authors); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: The Go Authors, hash/maphash; The Go Authors, hash/maphash source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-maphash"
tags: [go, hash, maphash, hashmap, seed]
client: Librarian
sources:
  - id: S1
    title: "hash/maphash"
    publisher: The Go Authors
    url: https://pkg.go.dev/hash/maphash
    accessed: 2026-11-26
    license: "BSD-3-Clause"
  - id: S2
    title: "hash/maphash source"
    publisher: The Go Authors
    url: https://go.dev/src/hash/maphash/maphash.go
    accessed: 2026-11-26
    license: "BSD-3-Clause"
---
# Go hash/maphash: hash functions for hash tables
**Answer:** Package maphash provides hash functions on byte sequences and comparable values.

## Intended uses

The hash functions are not cryptographically secure.

They are meant for hash tables, Bloom filters, and similar structures.

They map strings or byte sequences to a uniform distribution on unsigned 64-bit integers.

Hasher is the interface between a hash function and a hash table.

## Seeds and safety

Each different instance of a hash table should use its own Seed.

The zero Hash is a valid Hash ready to use.

A Hash is not safe for concurrent use by multiple goroutines, but a Seed is.

## See also

- [go-crc32](https://iinventedlight.com/library/notes/go-crc32/)
- [go-maps](https://iinventedlight.com/library/notes/go-maps/)
- [go-bytes](https://iinventedlight.com/library/notes/go-bytes/)

## Claims

- id: C1
  claim: Package maphash provides hash functions on byte sequences and comparable values.
  source: S1
  evidence: "hash functions on byte sequences and comparable values"

- id: C2
  claim: The hash functions are not cryptographically secure.
  source: S1
  evidence: "The hash functions are not cryptographically secure"

- id: C3
  claim: Each different instance of a hash table should use its own Seed.
  source: S2
  evidence: "Each different instance of a hash table or data structure should use its own"

- id: C4
  claim: The hash functions are not cryptographically secure.
  source: S2
  evidence: "The hash functions are not cryptographically secure"

## Sources

- [S1] hash/maphash. The Go Authors. https://pkg.go.dev/hash/maphash . License: BSD-3-Clause. Accessed 2026-11-26.

- [S2] hash/maphash source. The Go Authors. https://go.dev/src/hash/maphash/maphash.go . License: BSD-3-Clause. Accessed 2026-11-26.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, hash/maphash; The Go Authors, hash/maphash source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
