caseconv

package
v2.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToLowerTable = "" /* 729-byte string literal not displayed */
	ToUpperTable = "" /* 729-byte string literal not displayed */
)
View Source
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

func FirstLowerIndex(b []byte) int

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

func FirstUpperIndex(b []byte) int

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

func ToLowerCopy(dst, src []byte, from int)

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

func ToUpperCopy(dst, src []byte, from int)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL