github.com/segmentio/encoding@v0.4.0/ascii/valid.go (about)

     1  //go:generate go run valid_asm.go -out valid_amd64.s -stubs valid_amd64.go
     2  package ascii
     3  
     4  import (
     5  	"github.com/segmentio/asm/ascii"
     6  )
     7  
     8  // Valid returns true if b contains only ASCII characters.
     9  func Valid(b []byte) bool {
    10  	return ascii.Valid(b)
    11  }
    12  
    13  // ValidBytes returns true if b is an ASCII character.
    14  func ValidByte(b byte) bool {
    15  	return ascii.ValidByte(b)
    16  }
    17  
    18  // ValidBytes returns true if b is an ASCII character.
    19  func ValidRune(r rune) bool {
    20  	return ascii.ValidRune(r)
    21  }
    22  
    23  // ValidString returns true if s contains only ASCII characters.
    24  func ValidString(s string) bool {
    25  	return ascii.ValidString(s)
    26  }