Skip to content

Commit

Permalink
fix: postgres SASL
Browse files Browse the repository at this point in the history
  • Loading branch information
Wack FX authored and Wack FX committed Jun 26, 2023
1 parent 12dcdaf commit 51a8eb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions cf/polyfills.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,8 @@ if (md5('hello') != '5d41402abc4b2a76b9719d911017c592') {
*/

const sha256 = (x) => {
return Crypto.subtle.digest("SHA-256", textEncoder.encode(x)).then((digest) =>
Array.from(new Uint8Array(digest))
.map((b) => b.toString(16).padStart(2, "0"))
.join("")
)
let message = x
if (!(x instanceof Uint8Array))
message = textEncoder.encode(x)
return Crypto.subtle.digest("SHA-256", message)
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@
"pg",
"database"
]
}
}

0 comments on commit 51a8eb8

Please sign in to comment.