package ascii

import "github.com/segmentio/asm/ascii"

Index

Functions

func EqualFold

func EqualFold(a, b []byte) bool

EqualFold is a version of bytes.EqualFold designed to work on ASCII input instead of UTF-8.

When the program has guarantees that the input is composed of ASCII characters only, it allows for greater optimizations.

func EqualFoldString

func EqualFoldString(a string, b string) bool

EqualFoldString is a version of strings.EqualFold designed to work on ASCII input instead of UTF-8.

When the program has guarantees that the input is composed of ASCII characters only, it allows for greater optimizations.

func HasPrefixFold

func HasPrefixFold(s, prefix []byte) bool

func HasPrefixFoldString

func HasPrefixFoldString(s, prefix string) bool

func HasSuffixFold

func HasSuffixFold(s, suffix []byte) bool

func HasSuffixFoldString

func HasSuffixFoldString(s, suffix string) bool

func Valid

func Valid(b []byte) bool

Valid returns true if b contains only ASCII characters.

func ValidByte

func ValidByte(b byte) bool

ValidBytes returns true if b is an ASCII character.

func ValidPrint

func ValidPrint(b []byte) bool

ValidPrint returns true if b contains only printable ASCII characters.

func ValidPrintByte

func ValidPrintByte(b byte) bool

ValidPrintBytes returns true if b is an ASCII character.

func ValidPrintRune

func ValidPrintRune(r rune) bool

ValidPrintBytes returns true if b is an ASCII character.

func ValidPrintString

func ValidPrintString(s string) bool

ValidPrintString returns true if s contains only printable ASCII characters.

func ValidRune

func ValidRune(r rune) bool

ValidBytes returns true if b is an ASCII character.

func ValidString

func ValidString(s string) bool

ValidString returns true if s contains only ASCII characters.

Source Files

ascii.go equal_fold.go equal_fold_amd64.go valid.go valid_amd64.go valid_print.go valid_print_amd64.go

Version
v1.2.0 (latest)
Published
Apr 27, 2022
Platform
linux/amd64
Imports
2 packages
Last checked
10 hours ago

Tools for package owners.