initial commits

master
Charles Iliya Krempeaux 2023-12-06 08:22:21 -08:00
parent d368500976
commit 35bab0d265
4 changed files with 2200 additions and 0 deletions

15
ctl/byte.go 100644
View File

@ -0,0 +1,15 @@
package ctl
// ByteIsControl returns whether a byte is a control character, as defined by IETF RFC-2616.
//
// CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
func ByteIsControlCharacter(value byte) bool {
switch {
case 0 <= value && value <= 31:
return true
case 127 == value:
return true
default:
return false
}
}

1085
ctl/byte_test.go 100644

File diff suppressed because it is too large Load Diff

15
ctl/rune.go 100644
View File

@ -0,0 +1,15 @@
package ctl
// RuneIsControl returns whether a rune is a control character, as defined by IETF RFC-2616.
//
// CTL = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
func RuneIsControlCharacter(value rune) bool {
switch {
case 0 <= value && value <= 31:
return true
case 127 == value:
return true
default:
return false
}
}

1085
ctl/rune_test.go 100644

File diff suppressed because it is too large Load Diff