HeadlinesBriefing favicon HeadlinesBriefing.com

Go UUID v7 bug forces constant 7000 segment in WebAssembly builds

Hacker News •
×

A Hacker News post details a reproducible bug in Go’s go1.27rc1 when generating UUID v7 for the js/wasm target. The author compiled a minimal program importing the “uuid” package and ran it with GOOS=js GOARCH=wasm. Every console output contained the segment “7000” in the middle of the identifier, e.g., 019ee60f‑29b3‑7000‑a12b‑f817e25db8f4.

The spec for UUID v7 expects the middle 16‑bit field to be random, providing entropy for collision resistance. By hard‑coding 7000, the Go implementation eliminates that randomness, which can cause duplicate IDs in high‑throughput browser environments. Libraries that rely on true randomness may see reduced uniqueness guarantees, a serious concern for distributed systems and client‑side caching.

The issue was flagged by @mimifuwacc, who shared the findings on X and linked the reproducible steps. No official comment from the Go team has appeared yet, but the report puts pressure on maintainers to address the bug before the stable 1.27 release. Developers targeting WebAssembly should monitor the repository for a forthcoming patch.

Workarounds currently involve swapping the uuid library for an alternative that generates v7 IDs manually or falling back to UUID v4 until the bug is fixed. The Go community recommends filing an issue on the golang/go repo with the minimal reproducer. Until the fix lands, production code that depends on true randomness should avoid the js/wasm UUID generator.