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

@@ -8,5 +8,6 @@
],
"yaml.schemas": {
"https://raw.githubusercontent.com/doanthuanthanh88/testapi6/main/schema.json": "*.yaml"
}
},
"cmake.sourceDirectory": "C:/Users/Mendez/Documents/Practicas de programacion/Proyecto-Hackathon (ITC)/hackathon-sfc-a9a4cee23109413188ee35ceac01dc07/windows"
}

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