aboutsummaryrefslogtreecommitdiff
path: root/lib/bytes/bytes.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2018-09-03 22:27:44 +0700
committerShulhan <ms@kilabit.info>2018-09-03 22:55:06 +0700
commitd3e6c2e902eb3a00c2dfdcde09bf35282ea63396 (patch)
tree63432c09e0dddb08942e7172f24666a811432bb5 /lib/bytes/bytes.go
parentaab053ef5c49bcc67f6de5477d9760ea4e3bf6ab (diff)
downloadpakakeh.go-d3e6c2e902eb3a00c2dfdcde09bf35282ea63396.tar.xz
Move all byte(s) related constant and functions from package text to bytes
Diffstat (limited to 'lib/bytes/bytes.go')
-rw-r--r--lib/bytes/bytes.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/bytes/bytes.go b/lib/bytes/bytes.go
index 549d82db..ad777180 100644
--- a/lib/bytes/bytes.go
+++ b/lib/bytes/bytes.go
@@ -2,13 +2,31 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Packages bytes contains common functions to manipulate slice of bytes.
+// Packages bytes provide a library for working with byte or slice of bytes.
package bytes
import (
"fmt"
)
+const (
+ // ASCIILetters contains list of lower and upper case characters in
+ // ASCII.
+ ASCIILetters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ // HexaLETTERS contains list of hexadecimal characters in upper cases.
+ HexaLETTERS = "0123456789ABCDEF"
+ // HexaLetters contains list of hexadecimal characters in lower and
+ // upper cases.
+ HexaLetters = "0123456789abcedfABCDEF"
+ // HexaLetters contains list of hexadecimal characters in lower cases.
+ Hexaletters = "0123456789abcedf"
+)
+
+var (
+ // ASCIISpaces contains list of white spaces in ASCII.
+ ASCIISpaces = []byte{'\t', '\n', '\v', '\f', '\r', ' '}
+)
+
//
// PrintHex will print each byte in slice as hexadecimal value into N column
// length.