summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/str.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/str.go b/lib/str.go
index e4df4b4..5ccbd33 100644
--- a/lib/str.go
+++ b/lib/str.go
@@ -14,6 +14,17 @@ func FillStr(a string, l int) string {
return b
}
+func FillBytes(c byte, l int) []byte {
+ if l < 1 {
+ return make([]byte, 0)
+ }
+ bs := make([]byte, l)
+ for i := 0; i < l; i++ {
+ bs[i] = c
+ }
+ return bs
+}
+
// Strip space and newline characters from string.
func stripSpaceChars(s string) string {
ss := ""