ppassword namespace

This commit is contained in:
Levi Neely 2025-03-01 21:26:17 +01:00
parent 70a4cfdf51
commit d4e89dd448
3 changed files with 4 additions and 4 deletions

View File

@ -269,7 +269,7 @@ static uint64_t uint_sqrt(uint64_t n) {
return m;
}
uint64_t psync_password_score(const char *cpassword) {
uint64_t ppassword_score(const char *cpassword) {
uint64_t score, oscore, num;
char unsigned *lpwd, *ldpwd, *password;
size_t plen, nlen;

View File

@ -34,6 +34,6 @@
#include <stdint.h>
uint64_t psync_password_score(const char *password);
uint64_t ppassword_score(const char *password);
#endif

View File

@ -2153,7 +2153,7 @@ int psync_upload_file_as(const char *remote_path, const char *remote_filename,
}
int psync_password_quality(const char *password) {
uint64_t score = psync_password_score(password);
uint64_t score = ppassword_score(password);
if (score < (uint64_t)1 << 30)
return 0;
if (score < (uint64_t)1 << 40)
@ -2163,7 +2163,7 @@ int psync_password_quality(const char *password) {
}
int psync_password_quality10000(const char *password) {
uint64_t score = psync_password_score(password);
uint64_t score = ppassword_score(password);
if (score < (uint64_t)1 << 30)
return score / (((uint64_t)1 << 30) / 10000 + 1);
if (score < (uint64_t)1 << 40)