Documentation
¶
Overview ¶
Package langcode holds the encoding the generated language table is written in. The generator and the runtime lookup both depend on it, so it lives in one place where they cannot drift apart. See the language package README for the reasoning.
Index ¶
Constants ¶
View Source
const ( // Max is the highest packed code. Anything above it is not three letters. Max uint16 = alphabetSize * alphabetSize * alphabetSize )
Variables ¶
This section is empty.
Functions ¶
func FNV32a ¶
FNV32a is the 32 bit FNV-1a hash of s, which is what the lookup names are matched on. The hasher does not escape, so this does not allocate.
func Pack ¶
Pack encodes an ISO 639-3 code written as text, lowercasing and skipping what is not a letter, so "NLD" and "n.l.d" both give nld. What survives has to be exactly three letters: padding or truncating "n/a" would quietly produce a different real language.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.