(user, password, salt)
| 49 | |
| 50 | // See AuthenticationMD5Password at https://www.postgresql.org/docs/current/static/protocol-flow.html |
| 51 | async function postgresMd5PasswordHash(user, password, salt) { |
| 52 | const inner = await md5(password + user) |
| 53 | const outer = await md5(Buffer.concat([Buffer.from(inner), salt])) |
| 54 | return 'md5' + outer |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Create a SHA-256 digest of the given data |