v2.0.0
dbcrypt
jBCrypt를 Dart로 옮긴 버전입니다. 구성 가능한 작업 인자와 함께 BCrypt를 사용하여 비밀번호를 암호화하고, 비밀번호를 확인할 수 있습니다.
47좋아요 1.4만30일 다운로드140Pub 점수
AndroidiOSWebmacOSWindowsLinux
JBCrypt의 Dart 버전
>=2.0.0 <3.0.0^1.16.4아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
This system hashes passwords using a version of Bruce Schneier's Blowfish block cipher with modifications designed to raise the cost of off-line password cracking. The computation cost of the algorithm is parameterised, so it can be increased as computers and Dart VM get faster.
Add to your pubspec.yaml the following:
dependencies:
dbcrypt: ^2.0.0
Hashing a password is easy:
import 'package:dbcrypt/dbcrypt.dart'
main() {
var plainPassword = "P@55w0rd";
var hashedPassword = new DBCrypt().hashpw(plainPassword, new DBCrypt().gensalt());
}
Comparing a plain and a hashed password is even easier:
var isCorrect = new DBCrypt().checkpw(plain, hashed);
Dependencies are installed using the Pub Package Manager.
# For running the tests it needs the 'dart' executable on your path.
# Execute the next command if it isn't already on your path:
export DART_SDK=path/to/dart/sdk
pub install
test/run.sh