-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add GetFilteredWordList to asset, this allows us to filter the …
…word list as we are creating the word list. Instead of creating an intermediate slice containing all words and creating another slice with filtered words feat!: add GenerateDigit to RNGService interface fix: issue where if you used a random seperator it wouldn't remove edge characters when it should have doc: add comments for public methods and other code where appropriate
- Loading branch information
Showing
17 changed files
with
549 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,51 @@ | ||
# libpass | ||
|
||
Library code which can be used to create tools which generate memorable passwords, used by [mempass](https://github.com/eljamo/mempass) | ||
A Go library specifically designed for generating secure and memorable passwords. It serves as the backbone for [mempass](https://https://github.com/eljamo/mempass) | ||
|
||
## Basic Usage | ||
|
||
``` | ||
package main | ||
import ( | ||
"fmt" | ||
"github.com/eljamo/libpass/v4/config" | ||
"github.com/eljamo/libpass/v4/service" | ||
) | ||
func main() { | ||
specialCharacters := []string{ | ||
"!", "@", "$", "%", "^", "&", "*", "-", "+", "=", ":", "|", "~", "?", "/", ".", ";", | ||
} | ||
config := &config.Config{ | ||
WordList: "EN", | ||
NumPasswords: 3, | ||
NumWords: 3, | ||
WordLengthMin: 4, | ||
WordLengthMax: 8, | ||
CaseTransform: "RANDOM", | ||
SeparatorCharacter: "RANDOM", | ||
SeparatorAlphabet: specialCharacters, | ||
PaddingDigitsBefore: 2, | ||
PaddingDigitsAfter: 2, | ||
PaddingType: "FIXED", | ||
PaddingCharacter: "RANDOM", | ||
SymbolAlphabet: specialCharacters, | ||
PaddingCharactersBefore: 2, | ||
PaddingCharactersAfter: 2, | ||
} | ||
svc, err := service.NewPasswordGeneratorService(config) | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
pws, err := svc.Generate() | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
fmt.Println(pws) | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module github.com/eljamo/libpass/v3 | ||
module github.com/eljamo/libpass/v4 | ||
|
||
go 1.21.4 | ||
go 1.21.5 | ||
|
||
require golang.org/x/text v0.14.0 |
Oops, something went wrong.