Skip to content

Commit 1f7642f

Browse files
committed
replace zxcvbn with blackpaper
Signed-off-by: George Lemon <georgelemon@protonmail.com>
1 parent 40af32d commit 1f7642f

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/valido/password.nim

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
# Made by Humans from OpenPeep
55
# https://github.com/openpeep/valido
66

7-
import pkg/zxcvbn
7+
import pkg/blackpaper
88

9-
proc isStrongPassword*(input: string, defaultEntropy = 50.00): bool =
10-
## Checks given input and determine its strength
11-
result = passwordEntropy(input) > defaultEntropy
9+
proc isStrongPassword*(input: string, defaultEntropy = 3.8): bool =
10+
## Checks given input and determine its strength based on the `passwordStrength`
11+
## function provided by the `pkg/blackpaper`
12+
##
13+
## Returns true if the password is classified as strong and meets the default entropy threshold.
14+
result = passwordStrength(input).strength == Strong and passwordStrength(input).score >= defaultEntropy

valido.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ skipDirs = @["data"]
1111

1212
requires "nim >= 1.6.10"
1313
requires "bigints"
14-
requires "zxcvbn"
14+
requires "blackpaper"
1515

1616
task dev, "dev":
1717
echo "\n✨ Compiling..." & "\n"

0 commit comments

Comments
 (0)