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, re-exported for the case conversion callers in the strings and bytes packages: they route inputs shorter than WordLen to byte-wise paths and align offsets they pass (such as ToLowerCopy's from) with WordLen-derived masks.
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 ToLowerCopy ¶ added in v2.1.2
ToLowerCopy writes the lower-cased content of src into dst starting at byte offset from. Bytes before from must already be present in dst, and len(dst) must equal len(src). src is only ever read — the strings package passes an unsafe view over a string's immutable backing memory — so no code path here may write through src.
from must be a multiple of WordLen and at or below the index of the first byte that lower-casing changes: when len(src) >= WordLen the overlapping tail store rewrites dst[n-WordLen:from) with case-converted bytes, which is only a no-op under that precondition.
Callers currently invoke this only with len(src) >= WordLen; the byte-wise tail below keeps the helper correct standalone for shorter inputs.
func ToLowerInPlace ¶ added in v2.1.2
func ToLowerInPlace(b []byte)
ToLowerInPlace lower-cases every ASCII uppercase byte of b in place.
func ToUpperCopy ¶ added in v2.1.2
ToUpperCopy writes the upper-cased content of src into dst starting at byte offset from. Bytes before from must already be present in dst, and len(dst) must equal len(src).
from must be a multiple of WordLen and at or below the index of the first byte that upper-casing changes; see ToLowerCopy for why, including the note on the byte-wise tail and the requirement that src is never written.
func ToUpperInPlace ¶ added in v2.1.2
func ToUpperInPlace(b []byte)
ToUpperInPlace upper-cases every ASCII lowercase byte of b in place.
Types ¶
This section is empty.