summaryrefslogtreecommitdiffstats
path: root/challenge/c05.go
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-06-19 10:04:46 -0400
committersiddharth <s@ricketyspace.net>2021-06-19 10:04:46 -0400
commite285c8aa4a03b4f96b1ab36a0fd4b1a6e810ec4b (patch)
treec9460c85466548a44855ab0af79de688132518c1 /challenge/c05.go
parent03346243733759bf44ba0bf51a2af4766490c277 (diff)
lib: update RepeatingXOR
- Change input type to []byte. - Change retur type to []byte. - Update RepeatingXOR calls in challenge 5 an 6.
Diffstat (limited to 'challenge/c05.go')
-rw-r--r--challenge/c05.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/challenge/c05.go b/challenge/c05.go
index a9b1682..a1413ef 100644
--- a/challenge/c05.go
+++ b/challenge/c05.go
@@ -10,12 +10,12 @@ import (
)
func C5() {
- icebaby := `Burning 'em, if you ain't quick and nimble
-I go crazy when I hear a cymbal`
- key := "ICE"
- es := lib.RepeatingXOR(icebaby, key)
- hs := lib.AsciiStrToHexStr(es)
- fmt.Printf("RepeatingXOR('%v', '%v') = %v\n", icebaby, key, hs)
+ icebaby := lib.StrToBytes(`Burning 'em, if you ain't quick and nimble
+I go crazy when I hear a cymbal`)
+ key := lib.StrToBytes("ICE")
+ eb := lib.RepeatingXOR(icebaby, key)
+ hs := lib.AsciiStrToHexStr(lib.BytesToStr(eb))
+ fmt.Printf("RepeatingXOR('%s', '%s') = %v\n", icebaby, key, hs)
}
// Output: