Documentation
¶
Index ¶
Constants ¶
const ( ToLowerTable = "" /* 729-byte string literal not displayed */ ToUpperTable = "" /* 729-byte string literal not displayed */ )
const WordLen = swar.WordLen
WordLen is the SWAR word width in bytes, and the length from which these helpers are worth a call: below it the conversion is a table lookup per byte, cheaper inline. The case packages gate on it; the From converters require it.
Variables ¶
This section is empty.
Functions ¶
func FirstLowerIndex ¶ added in v2.1.2
FirstLowerIndex returns the index of the first ASCII lowercase byte in b, or -1 if b contains none. b is only ever read; it may be an unsafe view over immutable string memory.
func FirstUpperIndex ¶ added in v2.1.2
FirstUpperIndex returns the index of the first ASCII uppercase byte in b, or -1 if b contains none. b is only ever read; it may be an unsafe view over immutable string memory.
func ToLowerFrom ¶ added in v2.5.3
ToLowerFrom returns a lower-cased copy of src. first must be FirstUpperIndex's own result, with 0 <= first < len(src) and len(src) >= WordLen: a larger first silently mis-converts, so it must not be cached or derived elsewhere.
src is only read, so it may be an unsafe view over immutable string memory; the result is freshly allocated and unaliased. strings.ToLower needs both.
func ToLowerInPlace ¶ added in v2.1.2
func ToLowerInPlace(b []byte)
ToLowerInPlace lower-cases every ASCII uppercase byte of b in place: four words per pinned group, then single words, then bytes.
func ToUpperFrom ¶ added in v2.5.3
ToUpperFrom mirrors ToLowerFrom, with first from FirstLowerIndex.
func ToUpperInPlace ¶ added in v2.1.2
func ToUpperInPlace(b []byte)
ToUpperInPlace upper-cases every ASCII lowercase byte of b in place; the loop shape mirrors ToLowerInPlace.
Types ¶
This section is empty.