(length = 24)
| 132 | } |
| 133 | |
| 134 | export const generatePassword = async (length = 24): Promise<string> => { |
| 135 | const buffer = Buffer.alloc(Math.ceil(length / 2)) |
| 136 | await util.promisify(crypto.randomFill)(buffer) |
| 137 | return buffer.toString("hex").substring(0, length) |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * Used to hash the password. |
no outgoing calls
no test coverage detected