Files
afterwork/lib/data/services/hash_password.dart
2024-09-01 04:08:50 +00:00

9 lines
289 B
Dart

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
}