bcrypt
1.2.0, released 11 months ago by alexastudillo.com
Hashes passwords using the BCrypt algorithm.
What it does
Provides functions to generate BCrypt hashes and verify passwords. It is a pure Dart implementation of the jBCrypt algorithm.
AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Implement secure password storage in authentication systems
- Need deterministic hashing with built‑in salt generation
- Require a lightweight dependency for password hashing
Skip it when
- Building a full authentication framework that already includes password hashing
- Using a platform‑specific native crypto library for performance
Strengths
- Standard, widely‑used BCrypt algorithm
- Pure Dart, no native code or platform dependencies
- No external dependencies
- Supports UTF‑8 and password length validation
Weaknesses
- Only password hashing, no higher‑level auth features
- No built‑in user management or session handling
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Add bcrypt to pubspec.yaml and import 'package:bcrypt/bcrypt.dart'. No build_runner or native permissions required.
final String hashed = BCrypt.hashpw('password', BCrypt.gensalt());
final bool isValid = BCrypt.checkpw('password', hashed);Alternatives
Packages that do the same job and could replace bcrypt.
- dbcrypt
A Dart port of jBCrypt for hashing and checking passwords with a configurable work factor.
50Compare - fling_units
Dependency-free, type-safe Dart library for unit conversion.
47Compare - http_status_code
A Dart library providing constants and helpers for HTTP status codes.
39Compare
Works with
Packages commonly used together with bcrypt: ones it builds on, ones built on it, and its own family.