Skip to content

Commit 4f14f2d

Browse files
committed
fix README for new interfaces
1 parent 4db662a commit 4f14f2d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

+12-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ ok github.com/jedib0t/go-passwords/password 8.178s
2828

2929
### Random Passwords
3030
```golang
31-
generator, err := password.NewGenerator(password.AlphaNumeric, 8)
31+
generator, err := password.NewGenerator(
32+
password.WithCharset(password.AlphaNumeric),
33+
password.WithLength(8),
34+
)
3235
if err != nil {
3336
panic(err.Error())
3437
}
@@ -56,7 +59,10 @@ Password # 10: "kIbf3Wsm"
5659

5760
### In a Loop
5861
```golang
59-
sequencer, err := password.NewSequencer(password.AllChars.WithoutAmbiguity(), 8)
62+
sequencer, err := password.NewSequencer(
63+
password.WithCharset(password.AllChars.WithoutAmbiguity()),
64+
password.WithLength(8),
65+
)
6066
if err != nil {
6167
panic(err.Error())
6268
}
@@ -87,7 +93,10 @@ Password # 10: "AAAAAAAK"
8793

8894
### Streamed (for async processing)
8995
```golang
90-
sequencer, err := password.NewSequencer(password.Charset("AB"), 5)
96+
sequencer, err := password.NewSequencer(
97+
password.WithCharset(password.Charset("AB")),
98+
password.WithLength(5),
99+
)
91100
if err != nil {
92101
panic(err.Error())
93102
}

0 commit comments

Comments
 (0)