13 lines
329 B
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();
|
|
}
|
|
} |