PasswordAlgorithm enum

Supported password hashing algorithms.

The default and OWASP-recommended choice is argon2id.

await PasswordGuard.hash(
  password: 'myPassword',
  algorithm: PasswordAlgorithm.argon2id,
);
Inheritance
Available extensions

Values

argon2id → const PasswordAlgorithm

Argon2id — OWASP recommended as of 2024.

Memory-hard, resistant to GPU/ASIC attacks. Works on all platforms (pure Dart).

bcrypt → const PasswordAlgorithm

bcrypt — battle-tested, widely supported.

Note: NOT available on web platforms. Use argon2id or pbkdf2 for web.

pbkdf2 → const PasswordAlgorithm

PBKDF2 with HMAC-SHA256.

Pure Dart — works on all platforms including web. Use when Argon2 is unavailable.

Properties

defaultConfig AlgorithmConfig

Available on PasswordAlgorithm, provided by the PasswordAlgorithmExtension extension

Returns the OWASP-recommended default config for this algorithm.
no setter
hashCode int
The hash code for this object.
no setterinherited
identifier String

Available on PasswordAlgorithm, provided by the PasswordAlgorithmExtension extension

Short identifier stored in the encoded hash string.
no setter
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<PasswordAlgorithm>
A constant List of the values in this enum, in order of their declaration.