From 66a3a35972b6330da73462d14eedf07158f7f299 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Mon, 31 Aug 2020 20:46:38 -0400 Subject: lib: BytesToHexStr -> AsciiStrToHexStr * challenge/c05.go (C5): Change BytesToHexStr call to AsciiStrToHexStr * lib/hex.go (BytesToHexStr): Rename to... (AsciiStrToHexStr): ...this. Change argument to string. --- lib/hex.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/hex.go') 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]) } -- cgit v1.2.3