From e0dddff176a01d410904b6750b3395de4f7e54db Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 21:39:00 +0200 Subject: plan 9: keyword cache keys on extension, max-read and Unicode tables, trims removed keywords --- internal/norm/norm.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'internal/norm') diff --git a/internal/norm/norm.go b/internal/norm/norm.go index 77bb604..701f765 100644 --- a/internal/norm/norm.go +++ b/internal/norm/norm.go @@ -5,6 +5,7 @@ package norm import ( + "fmt" "strings" "unicode" @@ -16,6 +17,13 @@ import ( // another version are discarded (spec ยง6.1). const Version = 1 +// Fingerprint names everything Text and Name's output depends on: Version, +// and the Unicode tables of the standard library and of x/text's +// normalisation, which a Go or x/text upgrade can change (review cache F4). +func Fingerprint() string { + return fmt.Sprintf("norm%d unicode%s nfd%s", Version, unicode.Version, unorm.Version) +} + // special holds the letters that do not decompose under Unicode NFD, so // Fold maps them explicitly. var special = map[rune]string{ -- cgit v1.3