summaryrefslogtreecommitdiffstats
path: root/lib/str.go
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-08-29 20:00:53 -0400
committerrsiddharth <s@ricketyspace.net>2020-08-29 20:00:53 -0400
commit3b0fb163cbac08a36b01f186b72e2a9cee4b7a2d (patch)
tree5c33a9744c675edb87e29e771b90ed2dfc9a2779 /lib/str.go
parented26b39e82cee901c785c13e3d1b669fbb502e14 (diff)
challenge: do challenge 3
* challenge/c03.go: Implement challenge 3 * cryptopals.go (main): Add handling to run challenge 3 * lib/brute.go (XORCrackSingleKey): New function. * lib/hex.go (HexStrToAsciiStr, ByteToHexStr): New functions. * lib/str.go (FillStr): New function.
Diffstat (limited to 'lib/str.go')
-rw-r--r--lib/str.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/str.go b/lib/str.go
new file mode 100644
index 0000000..e0cb8ae
--- /dev/null
+++ b/lib/str.go
@@ -0,0 +1,15 @@
+// Copyright © 2020 rsiddharth <s@ricketyspace.net>
+// SPDX-License-Identifier: ISC
+
+package lib
+
+func FillStr(a string, l int) string {
+ b := ""
+ if l < 1 {
+ return b
+ }
+ for i := 0; i < l; i++ {
+ b += a
+ }
+ return b
+}