feat: agregar clase PasswordHasher para el hash de contraseñas
This commit is contained in:
13
lib/core/security/password_hasher.dart
Normal file
13
lib/core/security/password_hasher.dart
Normal file
@@ -0,0 +1,13 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
class PasswordHasher {
|
||||
static const String _salt = 'waste-notify-local-salt-v1';
|
||||
|
||||
static String hash(String password) {
|
||||
final normalized = password.trim();
|
||||
final bytes = utf8.encode('$_salt:$normalized');
|
||||
return sha256.convert(bytes).toString();
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user