Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: hunter007 <[email protected]>
  • Loading branch information
hunter007 committed Sep 20, 2023
1 parent e9dac38 commit 86aee8b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ go get github.com/hunter007/password

## Usage

#### 0. Generate password

```go
// 1. generate password via default config
p, _ := password.Generate(12, 4, 2, 1)

// 2. make a custom config. Any utf8 char is supported.
c := Config{
UpperLetters: "壹贰叁肆伍陆柒捌玖拾",
LowerLetters: "一二三四五六七八九十",
Digits: "①②③④⑤⑥⑦⑧⑨⑩0️⃣✅",
Symbols: "😭😁😄😞👏🏻🙋🏻‍♀️😴🔥",
}
g := NewGenerator(c)
p, _ := g.Generate(16, 4, 3, 0)
```

#### 1. Validate password

```go
Expand Down
1 change: 0 additions & 1 deletion TODOs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- Generate password
- imporove performence
- sync.Pool
- add benchmark test
Expand Down

0 comments on commit 86aee8b

Please sign in to comment.