Skip to content

Commit 3883464

Browse files
authored
Merge pull request #45 from abbasmousavi/master
digest is depricated, changed to hash
2 parents 852f248 + 0e6a468 commit 3883464

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/PostgreSQL/Connection/PostgreSQLConnection.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ public final class PostgreSQLConnection {
114114
}
115115

116116
// pwdhash = md5(password + username).hexdigest()
117-
let pwdhash = try MD5.digest(passwordData + usernameData).hexEncodedString()
117+
let pwdhash = try MD5.hash(passwordData + usernameData).hexEncodedString()
118118
// hash = "md5" + md 5(pwdhash + salt).hexdigest()
119-
let hash = try "md5" + MD5.digest(Data(pwdhash.utf8) + salt).hexEncodedString()
119+
let hash = try "md5" + MD5.hash(Data(pwdhash.utf8) + salt).hexEncodedString()
120120

121121
let passwordMessage = PostgreSQLPasswordMessage(password: hash)
122122
input = [.password(passwordMessage)]

0 commit comments

Comments
 (0)