Skip to content

Commit

Permalink
Raise default password length to 64
Browse files Browse the repository at this point in the history
  • Loading branch information
sc-david-voisin committed Aug 27, 2024
1 parent 313d0c6 commit c866c85
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## To be Released

* chore(go): use go 1.22
* Raise default length from 20 to 24
* Raise default length from 20 to 64
* Allow `_` only as special character

## 1.0.3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Simple password generator in Go. Use `crypto/rand`

```go
// Password of 24 characters
// Password of 64 characters
gopassword.Generate()

// Password of 42 characters
Expand Down
2 changes: 1 addition & 1 deletion gopassword.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
)

const defaultLength = 24
const defaultLength = 64
const defaultSpecialChar = "_"

func Generate(n ...int) string {
Expand Down
4 changes: 2 additions & 2 deletions gopassword_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

func TestGenerate(t *testing.T) {
t.Run("When we want to generate a password", func(t *testing.T) {
t.Run("By default, it must be 24 characters", func(t *testing.T) {
assert.Len(t, Generate(), 24)
t.Run("By default, it must be 64 characters", func(t *testing.T) {
assert.Len(t, Generate(), 64)
})

t.Run("With an argument, the generated password must have its length", func(t *testing.T) {
Expand Down

0 comments on commit c866c85

Please sign in to comment.