summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-08-31 20:46:38 -0400
committerrsiddharth <s@ricketyspace.net>2020-08-31 20:46:38 -0400
commit66a3a35972b6330da73462d14eedf07158f7f299 (patch)
tree18826357ecb94c2e783d0ff9928139d1b005c80b /lib
parentd944fa2586adea8b58ee4f07497ff197df28bc2c (diff)
lib: BytesToHexStr -> AsciiStrToHexStr
* challenge/c05.go (C5): Change BytesToHexStr call to AsciiStrToHexStr * lib/hex.go (BytesToHexStr): Rename to... (AsciiStrToHexStr): ...this. Change argument to string.
Diffstat (limited to 'lib')
-rw-r--r--lib/hex.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/hex.go b/lib/hex.go
index 5b1741f..0087f33 100644
--- a/lib/hex.go
+++ b/lib/hex.go
@@ -54,12 +54,13 @@ func ByteToHexStr(b byte) string {
return s
}
-func BytesToHexStr(bs []byte) string {
+func AsciiStrToHexStr(as string) string {
hs := ""
- if len(bs) < 1 {
+ if len(as) < 1 {
return hs
}
+ bs := []byte(as)
for i := 0; i < len(bs); i++ {
hs += ByteToHexStr(bs[i])
}