This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* Password hashing | |
* | |
* In essence, passwords are hashed with a global salt (the same for every password), which is | |
* to remain secret, and a local salt (only specific to one password). If you don't provide | |
* local salt to `hashPassword`, it will generate one for you. | |
* The result is a 48-byte long buffer which includes your hashed password along with the local | |
* salt in clear, that you can store in your DB. You may call buffer.toString('hex') in case | |
* you want to store it as hex and waste space. | |
* |