refactoring
This commit is contained in:
8
lib/data/services/hash_password.dart
Normal file
8
lib/data/services/hash_password.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
import 'dart:convert';
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
String hashPassword(String password) {
|
||||
var bytes = utf8.encode(password); // Convertir en bytes
|
||||
var digest = sha256.convert(bytes); // Hachage SHA-256
|
||||
return digest.toString(); // Retourner le hash sous forme de chaîne
|
||||
}
|
||||
Reference in New Issue
Block a user