From 3cdc462d3f0e8240c311e7c62d0b3f009ccc0849 Mon Sep 17 00:00:00 2001 From: Gowtham Gopalakrishnan Date: Sat, 17 Nov 2018 19:59:15 +0530 Subject: [PATCH] Typo fix and readibility improvements --- base16.go | 6 +++--- multibase-conv/main.go | 4 ++-- multibase.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/base16.go b/base16.go index ac8c819..6b87941 100644 --- a/base16.go +++ b/base16.go @@ -6,15 +6,15 @@ func hexEncodeToStringUpper(src []byte) string { return string(dst) } -var hextableUpper = [16]byte{ +var hexTableUppers = [16]byte{ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', } func hexEncodeUpper(dst, src []byte) int { for i, v := range src { - dst[i*2] = hextableUpper[v>>4] - dst[i*2+1] = hextableUpper[v&0x0f] + dst[i*2] = hexTableUppers[v>>4] + dst[i*2+1] = hexTableUppers[v&0x0f] } return len(src) * 2 diff --git a/multibase-conv/main.go b/multibase-conv/main.go index cec445b..a6d80a0 100644 --- a/multibase-conv/main.go +++ b/multibase-conv/main.go @@ -14,8 +14,8 @@ func main() { } var newBase multibase.Encoding - if baseParm := os.Args[1]; len(baseParm) != 0 { - newBase = multibase.Encoding(baseParm[0]) + if baseParam := os.Args[1]; len(baseParam) != 0 { + newBase = multibase.Encoding(baseParam[0]) } else { fmt.Fprintln(os.Stderr, " is empty") os.Exit(1) diff --git a/multibase.go b/multibase.go index 478fa6d..38cbfb8 100644 --- a/multibase.go +++ b/multibase.go @@ -38,7 +38,7 @@ const ( Base64urlPad = 'U' ) -// Encodigs is a map of the supported encoding, unsupported encoding +// Encodings is a map of the supported encoding, unsupported encoding // specified in standard are left out var Encodings = map[string]Encoding{ "identity": 0x00,