mirror of
https://github.com/status-im/status-go.git
synced 2025-02-20 10:48:36 +00:00
* feat_: LogOnPanic linter * fix_: add missing defer LogOnPanic * chore_: make vendor * fix_: tests, address pr comments * fix_: address pr comments
19 lines
486 B
Go
19 lines
486 B
Go
package ascii
|
|
|
|
import "github.com/segmentio/asm/internal/unsafebytes"
|
|
|
|
// ValidPrint returns true if b contains only printable ASCII characters.
|
|
func ValidPrint(b []byte) bool {
|
|
return ValidPrintString(unsafebytes.String(b))
|
|
}
|
|
|
|
// ValidPrintBytes returns true if b is an ASCII character.
|
|
func ValidPrintByte(b byte) bool {
|
|
return 0x20 <= b && b <= 0x7e
|
|
}
|
|
|
|
// ValidPrintBytes returns true if b is an ASCII character.
|
|
func ValidPrintRune(r rune) bool {
|
|
return 0x20 <= r && r <= 0x7e
|
|
}
|