pub fn md5_password(username: &str, password: &str, salt: &[u8; 4]) -> BytesMutExpand description
Computes the MD5 password hash for Postgres authentication.
The hash is computed as: md5(md5(password + username) + salt)
§Arguments
username- The database usernamepassword- The user’s passwordsalt- The 4-byte salt provided by the server
§Returns
A BytesMut containing the password message ready to be sent.
§Example
use pg_stream::auth::md5_password;
let salt = [0x12, 0x34, 0x56, 0x78];
let msg = md5_password("postgres", "secret", &salt);
// Send msg to the server