Initial commit - app-padrao-1.0
This commit is contained in:
15
lib/core/utils/password_utils.dart
Normal file
15
lib/core/utils/password_utils.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'dart:convert';
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
class PasswordUtils {
|
||||
// Hash simples para senha (para produção real, usar bcrypt)
|
||||
static String hashPassword(String password) {
|
||||
final bytes = utf8.encode(password);
|
||||
final digest = sha256.convert(bytes);
|
||||
return digest.toString();
|
||||
}
|
||||
|
||||
static bool verifyPassword(String password, String hash) {
|
||||
return hashPassword(password) == hash;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user