Files
hackathon-sfc-a9a4cee231094…/lib/core/security/password_hasher.dart

13 lines
329 B
Dart

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();
}
}