From a0e91b5a7a9a0981e9df3972f52d6ef1f9e69a92 Mon Sep 17 00:00:00 2001 From: Nicolas Guerrero Date: Fri, 31 Jul 2020 17:34:33 -0500 Subject: [PATCH] Bump Deno to v1.2.2, replace checksum lib for std/hash --- .github/workflows/ci.yml | 2 +- connection.ts | 2 +- deps.ts | 11 ++++------- test_deps.ts | 2 +- utils.ts | 4 ++-- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af215f73..05913ac1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: Install deno uses: denolib/setup-deno@master with: - deno-version: 1.2.0 + deno-version: 1.2.2 - name: Check formatting run: deno fmt --check diff --git a/connection.ts b/connection.ts index 07b3452b..cef18b87 100644 --- a/connection.ts +++ b/connection.ts @@ -26,7 +26,7 @@ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import { BufReader, BufWriter, Hash } from "./deps.ts"; +import { BufReader, BufWriter } from "./deps.ts"; import { PacketWriter } from "./packet_writer.ts"; import { hashMd5Password, readUInt32BE } from "./utils.ts"; import { PacketReader } from "./packet_reader.ts"; diff --git a/deps.ts b/deps.ts index b3d75775..1e135614 100644 --- a/deps.ts +++ b/deps.ts @@ -1,13 +1,10 @@ export { BufReader, BufWriter, -} from "https://deno.land/std@0.61.0/io/bufio.ts"; - -export { copyBytes } from "https://deno.land/std@0.61.0/bytes/mod.ts"; - +} from "https://deno.land/std@0.63.0/io/bufio.ts"; +export { copyBytes } from "https://deno.land/std@0.63.0/bytes/mod.ts"; export { Deferred, deferred, -} from "https://deno.land/std@0.61.0/async/deferred.ts"; - -export { Hash } from "https://deno.land/x/checksum@1.2.0/mod.ts"; +} from "https://deno.land/std@0.63.0/async/deferred.ts"; +export { createHash } from "https://deno.land/std@0.63.0/hash/mod.ts"; diff --git a/test_deps.ts b/test_deps.ts index b0cfd877..f84ef633 100644 --- a/test_deps.ts +++ b/test_deps.ts @@ -5,4 +5,4 @@ export { assertStringContains, assertThrows, assertThrowsAsync, -} from "https://deno.land/std@0.61.0/testing/asserts.ts"; +} from "https://deno.land/std@0.63.0/testing/asserts.ts"; diff --git a/utils.ts b/utils.ts index baa26c3b..c473af63 100644 --- a/utils.ts +++ b/utils.ts @@ -1,4 +1,4 @@ -import { Hash } from "./deps.ts"; +import { createHash } from "./deps.ts"; export function readInt16BE(buffer: Uint8Array, offset: number): number { offset = offset >>> 0; @@ -36,7 +36,7 @@ export function readUInt32BE(buffer: Uint8Array, offset: number): number { const encoder = new TextEncoder(); function md5(bytes: Uint8Array): string { - return new Hash("md5").digest(bytes).hex(); + return createHash("md5").update(bytes).toString("hex"); } // https://www.postgresql.org/docs/current/protocol-flow.html