Update js/auth/authentication.js
Browse files
js/auth/authentication.js
CHANGED
|
@@ -31,14 +31,14 @@ class Authentication {
|
|
| 31 |
return null;
|
| 32 |
}
|
| 33 |
}
|
| 34 |
-
|
| 35 |
hashPassword(password) {
|
| 36 |
// هش ساده برای محیط توسعه - در تولید از روش امنتری استفاده شود
|
| 37 |
let hash = 0;
|
| 38 |
for (let i = 0; i < password.length; i++) {
|
| 39 |
const char = password.charCodeAt(i);
|
| 40 |
hash = ((hash << 5) - hash) + char;
|
| 41 |
-
hash = hash & hash;
|
| 42 |
}
|
| 43 |
return hash.toString();
|
| 44 |
}
|
|
|
|
| 31 |
return null;
|
| 32 |
}
|
| 33 |
}
|
| 34 |
+
|
| 35 |
hashPassword(password) {
|
| 36 |
// هش ساده برای محیط توسعه - در تولید از روش امنتری استفاده شود
|
| 37 |
let hash = 0;
|
| 38 |
for (let i = 0; i < password.length; i++) {
|
| 39 |
const char = password.charCodeAt(i);
|
| 40 |
hash = ((hash << 5) - hash) + char;
|
| 41 |
+
hash = Math.abs(hash & hash);
|
| 42 |
}
|
| 43 |
return hash.toString();
|
| 44 |
}
|