HashConfig class final
HASH_DRIVER / BCRYPT_ROUNDS / ARGON_* configuration
(config/hashing.php parity).
- Implemented types
Constructors
- HashConfig({HashDriver driver = .bcrypt, int bcryptRounds = 12, int argonMemory = 65536, int argonTime = 3, int argonThreads = 1, int pbkdf2Iterations = 600000, bool verify = true})
-
Hash settings; usually from
.env(HASH_DRIVER,BCRYPT_ROUNDS...).const - HashConfig.fromEnv(Env env)
-
Reads the environment;
APP_ENV=testinglowers every cost so test suites stay fast (Laravel does the same inphpunit.xml).factory
Properties
- argonMemory → int
-
Argon2id memory in KiB.
final
- argonThreads → int
-
The argon2id parallelism.
final
- argonTime → int
-
The argon2id iterations.
final
- bcryptRounds → int
-
The bcrypt cost (12).
final
- driver → HashDriver
-
The driver new hashes use (
bcrypt).final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
Top-level key of the section, e.g.
appordatabase.no setteroverride - pbkdf2Iterations → int
-
The PBKDF2 iterations.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- verify → bool
-
When true, HashManager.check refuses hashes of a different driver
unless they belong to the strong family ({bcrypt, argon2id}, ADR-024):
legacy or weak formats (pbkdf2) cannot be injected as a downgrade, while
a bcrypt ⇄ argon2id switch still verifies old hashes so
rehashPasswordIfRequiredcan upgrade them at login.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, Object?> -
Plain-map projection used for dot-notation access.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited