feat: agregar clase PasswordHasher para el hash de contraseñas

This commit is contained in:
Moisés Méndez
2026-05-23 08:32:45 -06:00
parent 649752a6a4
commit 218ad84991
3 changed files with 169 additions and 7 deletions

View 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