diff options
author | rsiddharth <s@ricketyspace.net> | 2020-08-30 20:15:58 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-08-30 20:15:58 -0400 |
commit | c1240b472934f0b7649922722fe0d61c0c1c6cac (patch) | |
tree | 2e35f187c5caf7e81486465cfe1170ef1ce0b0e6 /lib/hex.go | |
parent | 60cd4c5cedf546c282b2bcb0f959596d4ed364a3 (diff) |
challenge: do challenge 5
* challenge/c05.go: Implement challenge 5.
* cryptopals.go (main): Add handling to run challenge 5.
* lib/hex.go (BytesToHexStr): New function.
* lib/xor.go (RepeatingXOR): New function.
Diffstat (limited to 'lib/hex.go')
-rw-r--r-- | lib/hex.go | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -53,3 +53,15 @@ func ByteToHexStr(b byte) string { return s } + +func BytesToHexStr(bs []byte) string { + hs := "" + if len(bs) < 1 { + return hs + } + + for i := 0; i < len(bs); i++ { + hs += ByteToHexStr(bs[i]) + } + return hs +} |