Apparently the rounds parameter for the method bcrypt.genSaltSync() has an upper bound of 31.
According to the _encodesalt in bcrypt.cc.
/**
* @param rounds The cost of processing the data. Default 10.
* @param minor The minor version of bcrypt to use. Either 'a' or 'b'. Default 'b'.
*
* @example
* import * as bcrypt from 'bcrypt';
* const saltRounds = 10;
*
* const salt = bcrypt.genSaltSync(saltRounds);
*/
export declare function genSaltSync(rounds?: number, minor?: "a" | "b"): string;
For higher numbers a cryptic error message is created which misleads people to thinking that they may have passed in an argument of wrong type or format.
Error: Invalid salt. Salt must be in the form of: $Vers$log2(NumRounds)$saltvalue
Apparently the rounds parameter for the method bcrypt.genSaltSync() has an upper bound of 31. According to the _encodesalt in bcrypt.cc.
For higher numbers a cryptic error message is created which misleads people to thinking that they may have passed in an argument of wrong type or format.