@h3ravel/hashing 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
# Hashing
|
|
16
16
|
|
|
17
|
-
The [H3ravel](https://h3ravel.toneflix.net) Hashing package provides secure Bcrypt and Argon2 hashing for storing user passwords. If you are using one of the H3ravel application starter kits, Bcrypt will be used for registration and authentication by default.
|
|
17
|
+
The [H3ravel](https://h3ravel.toneflix.net) Hashing package provides framework-agnostic secure Bcrypt and Argon2 hashing for storing user passwords with first class support for H3ravel. If you are using one of the H3ravel application starter kits, Bcrypt will be used for registration and authentication by default.
|
|
18
18
|
|
|
19
19
|
> Bcrypt is a great choice for hashing passwords because its "work factor" is adjustable, which means that the time it takes to generate a hash can be increased as hardware power increases. When hashing passwords, slow is good. The longer an algorithm takes to hash a password, the longer it takes malicious users to generate "rainbow tables" of all possible string hash values that may be used in brute force attacks against applications.
|
|
20
20
|
|
package/dist/index.cjs
CHANGED
|
@@ -107,7 +107,7 @@ var Argon2idHasher = class extends AbstractHasher {
|
|
|
107
107
|
constructor(options = {}) {
|
|
108
108
|
super();
|
|
109
109
|
this.memory = options.memory ?? this.memory;
|
|
110
|
-
this.verifyAlgorithm = options.verify ?? this.verifyAlgorithm;
|
|
110
|
+
this.verifyAlgorithm = options.verify ?? process.env.HASH_VERIFY ?? this.verifyAlgorithm;
|
|
111
111
|
this.threads = options.threads ?? this.threads;
|
|
112
112
|
this.time = options.time ?? this.time;
|
|
113
113
|
}
|
|
@@ -215,7 +215,7 @@ var ArgonHasher = class extends AbstractHasher {
|
|
|
215
215
|
constructor(options = {}) {
|
|
216
216
|
super();
|
|
217
217
|
this.memory = options.memory ?? this.memory;
|
|
218
|
-
this.verifyAlgorithm = options.verify ?? this.verifyAlgorithm;
|
|
218
|
+
this.verifyAlgorithm = options.verify ?? process.env.HASH_VERIFY ?? this.verifyAlgorithm;
|
|
219
219
|
this.threads = options.threads ?? this.threads;
|
|
220
220
|
this.time = options.time ?? this.time;
|
|
221
221
|
}
|
|
@@ -2215,7 +2215,7 @@ var BcryptHasher = class extends AbstractHasher {
|
|
|
2215
2215
|
constructor(options = {}) {
|
|
2216
2216
|
super();
|
|
2217
2217
|
this.rounds = options.rounds ?? this.rounds;
|
|
2218
|
-
this.verifyAlgorithm = options.verify ?? this.verifyAlgorithm;
|
|
2218
|
+
this.verifyAlgorithm = options.verify ?? process.env.HASH_VERIFY ?? this.verifyAlgorithm;
|
|
2219
2219
|
this.limit = options.limit ?? this.limit;
|
|
2220
2220
|
}
|
|
2221
2221
|
/**
|
|
@@ -10609,7 +10609,7 @@ var Manager = class {
|
|
|
10609
10609
|
* @return string
|
|
10610
10610
|
*/
|
|
10611
10611
|
getDefaultDriver() {
|
|
10612
|
-
return this.config.driver ?? "bcrypt";
|
|
10612
|
+
return this.config.driver ?? process.env.HASH_DRIVER ?? "bcrypt";
|
|
10613
10613
|
}
|
|
10614
10614
|
createDriver(driver) {
|
|
10615
10615
|
const method = "create" + __h3ravel_support.Str.studly(driver) + "Driver";
|