From 13540386fd5a69fb93c024b877920f00a1e68997 Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Mon, 22 Nov 2021 15:56:38 -0800 Subject: [PATCH] password --- t_password.go | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/t_password.go b/t_password.go index 2a12f8a..d2f2a74 100644 --- a/t_password.go +++ b/t_password.go @@ -25,6 +25,13 @@ func (arb T) Password() string { var s string = words[arb.randomness.Intn(len(words))] + if 0 == arb.randomness.Intn(4) { + s = strings.ToUpper(s) + } + if 0 == arb.randomness.Intn(4) { + s = strings.ToTitle(s) + } + storage.WriteString(s) } @@ -35,5 +42,61 @@ func (arb T) Password() string { result = arb.String() } + if 0 == arb.randomness.Intn(2) { + + if 0 == arb.randomness.Intn(4) { + result = strings.Replace(result, " ", ".", 1) + } + + if 0 == arb.randomness.Intn(2) { + result = strings.ReplaceAll(result, " ", "_") + } + } + + if 0 == arb.randomness.Intn(2) { + + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "A", "4", 1) + } + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "a", "4", 1) + } + + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "E", "3", 1) + } + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "e", "3", 1) + } + + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "G", "9", 1) + } + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "g", "9", 1) + } + + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "I", "1", 1) + } + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "i", "1", 1) + } + + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "O", "0", 1) + } + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "o", "0", 1) + } + + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "S", "$", 1) + } + if 0 == arb.randomness.Intn(2) { + result = strings.Replace(result, "s", "$", 1) + } + } + return result }