mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-17 20:29:30 +02:00
feat: Add initial backend server with user authentication, session management, and playlist CRUD functionality.
This commit is contained in:
1 parent
a1ce183cd3
commit
ac4f274031
19 files changed
+1324
-75
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import 'dart:convert';
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
class PasswordHasher {
|
||||
/// Hash a password using SHA256 (simple implementation)
|
||||
/// Note: In production, use a proper bcrypt implementation
|
||||
static String hash(String password) {
|
||||
final bytes = utf8.encode(password);
|
||||
final digest = sha256.convert(bytes);
|
||||
return digest.toString();
|
||||
}
|
||||
|
||||
/// Verify a password against a hash
|
||||
static bool verify(String password, String hash) {
|
||||
return PasswordHasher.hash(password) == hash;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user