add alot
This commit is contained in:
@@ -4,12 +4,9 @@ import 'dart:math';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
|
||||
/// Stores and verifies a PIN. The raw PIN is never persisted — only a
|
||||
/// salted SHA-256 hash of it, kept in secure storage (Keychain on iOS,
|
||||
/// EncryptedSharedPreferences/Keystore on Android).
|
||||
class PinLockService {
|
||||
PinLockService({FlutterSecureStorage? storage})
|
||||
: _storage = storage ?? const FlutterSecureStorage();
|
||||
: _storage = storage ?? const FlutterSecureStorage();
|
||||
|
||||
static const _saltKey = 'pin_salt';
|
||||
static const _hashKey = 'pin_hash';
|
||||
@@ -53,4 +50,4 @@ class PinLockService {
|
||||
final bytes = utf8.encode('$salt:$pin');
|
||||
return sha256.convert(bytes).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user