new Hasher()
- Source:
Methods
-
(static) generateHash(seedSHA, salt, iterations) → {string}
Function to obtain a url-safe base64-encoded key-stretched hash of the seed and the salt using the PBKDF2-HMAC-SHA256 algorithm. Both the "seed" and the "salt" are encoded to SHA256 before feeding into the algorithm.
-
Parameters:
Name Type Description seedSHAstring The SHA256-encoded seed password. saltstring The input salt. iterationsint The number of PBKDF2 iterations. - Source:
Returns:
The proxy password hash object generated by PBKDF2 encoded in base64.- Type
- string
-
(static) generateSalt() → {string}
-
- Source:
Properties:
Name Type Description domainstring The website domain. saltKeystring The "key" used to strengthen the salt. iterationsint The number of PBKDF2 iterations. Returns:
The generated "strengthened" salt, encoded in base64. A base64 encoding is chosen since it has characters from the set [A-Z][a-z][0-9](+,/), which looks like "mangled" text.- Type
- string
-
(static) getPasswdStr(b64Hash, truncation) → {string}
Function to return the final password string from the base64-encoded proxy password, by replacing trailing "="s, and converting the encoding to "urlsafe" as per RFC 4648.
-
Parameters:
Name Type Description b64Hashstring The PBKDF2 hash encoded in base64. truncationint The number of characters to truncate to. If this is negative, no truncation will be performed. - Source:
Returns:
The final password string.- Type
- string