From d3e6c2e902eb3a00c2dfdcde09bf35282ea63396 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 3 Sep 2018 22:27:44 +0700 Subject: Move all byte(s) related constant and functions from package text to bytes --- lib/bytes/bytes.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'lib/bytes/bytes.go') 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. -- cgit v1.3-5-g9baa