mirror of
https://github.com/wneessen/apg-go.git
synced 2024-11-09 15:52:54 +01:00
Refactor variable names in random.go
Updated variable naming within the CoinFlip function to enhance clarity. Also added an additional case statement within the Generate function for the 'AlgoPronouncable' algorithm. These changes improve readability and extend the functionality of the random number generation code.
This commit is contained in:
parent
b6f91459c5
commit
0ad5f4a74d
1 changed files with 3 additions and 2 deletions
|
@ -32,8 +32,8 @@ var (
|
|||
|
||||
// CoinFlip performs a simple coinflip based on the rand library and returns 1 or 0
|
||||
func (g *Generator) CoinFlip() int64 {
|
||||
cf, _ := g.RandNum(2)
|
||||
return cf
|
||||
coinFlip, _ := g.RandNum(2)
|
||||
return coinFlip
|
||||
}
|
||||
|
||||
// CoinFlipBool performs a simple coinflip based on the rand library and returns true or false
|
||||
|
@ -45,6 +45,7 @@ func (g *Generator) CoinFlipBool() bool {
|
|||
// it as string type. If the generation fails, an error will be thrown
|
||||
func (g *Generator) Generate() (string, error) {
|
||||
switch g.config.Algorithm {
|
||||
case AlgoPronouncable:
|
||||
case AlgoCoinFlip:
|
||||
return g.generateCoinFlip()
|
||||
case AlgoRandom:
|
||||
|
|
Loading…
Reference in a new issue