From cd5e535394fcf8ecbe7ba128bf4515448c297a95 Mon Sep 17 00:00:00 2001 From: Solaris-star <820622658@qq.com> Date: Fri, 24 Jul 2026 00:24:33 +0800 Subject: [PATCH] docs: warn that zero-valued Digest needs New/Reset A zero Digest is a sharp edge when embedded in larger structs (#65). Call out New/Reset in the README next to the Digest API. Fixes #65 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 06a0307..4a96daf 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ func (*Digest) WriteString(string) (int, error) func (*Digest) Sum64() uint64 ``` +**Note:** a zero-valued `Digest` is not initialized. Call `New()` (or `Reset()` / +`ResetWithSeed`) before writing, especially if you embed `Digest` in another +struct (#65). + The package is written with optimized pure Go and also contains even faster assembly implementations for amd64 and arm64. If desired, the `purego` build tag opts into using the Go code even on those architectures.