FlutterBcrypt class

Constructors

FlutterBcrypt()

Properties

hashCode int
The hash code for this object.
no setterinherited
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

Static Methods

hashPw({required String password, required String salt}) Future<String>
Create passworde hash for given password and salt. Password must be a plain UTF-8 compatible String. Salt must be a string in Modular Crypt Format with $ separators for example r'$2b$06$C6UzMDM.H6dfI/f/IKxGhu'
salt() Future<String>
Generate a 16 byte salt with 6 rounds of cost in Modular Crypt Format.
saltWithRounds({required int rounds}) Future<String>
Generate a salt with a given cost. Cost must be between 4 and 31.
verify({required String password, required String hash}) Future<bool>
Verify if the given password matches the given hash. Password must be a plain UTF-8 compatible String Hash must be provided in Modular Crypt Format. Eg. $2y$06$doGnefu9cbLkJTn8sef7U.dynHJFe5hS6xp7vLWb2Zu7e8cOuMVmS This includes the version, complexity and 16 bytes of salt.