Browse Source

Updated devtools

master
Michaël Lemaire 6 months ago
parent
commit
74f4be962e
  1. 2
      deps.test.ts
  2. 4
      hashing.test.ts
  3. 4
      sha.test.ts
  4. 4
      sha.ts

2
deps.test.ts

@ -1 +1 @@
export * from "https://code.thunderk.net/typescript/devtools/raw/1.0.0/testing.ts";
export * from "https://code.thunderk.net/typescript/devtools/raw/1.2.2/testing.ts";

4
hashing.test.ts

@ -1,9 +1,9 @@
import { test, expect } from "./deps.test.ts";
import { expect, it } from "./deps.test.ts";
import { Hasher, HashOutputMode } from "./hashing.ts";
const assertEquals = (a: any, b: any) => expect(a).toEqual(b);
test("hasher", () => {
it("hasher", () => {
assertEquals(Hasher.tagFromURL(""), null);
assertEquals(Hasher.tagFromURL("http://"), null);
assertEquals(Hasher.tagFromURL("http://localhost"), "localhost");

4
sha.test.ts

@ -1,7 +1,7 @@
import { test, expect } from "./deps.test.ts";
import { expect, it } from "./deps.test.ts";
import { hex_sha1 } from "./sha.ts";
test("sha1", () => {
it("sha1", () => {
expect(hex_sha1("abc")).toEqual("a9993e364706816aba3e25717850c26c9cd0d89d");
expect(hex_sha1("test")).toEqual("a94a8fe5ccb19ba61c4c0873d391e987982fbbd3");
});

4
sha.ts

@ -162,8 +162,8 @@ function str2binb(str: string): number[] {
/* SC - Get rid of warnings */
for (var i = 0; i < str.length * chrsz; i += chrsz) {
if (bin[i >> 5] != undefined) {
bin[i >> 5] |=
(str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i % 32);
bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) <<
(32 - chrsz - i % 32);
} else {
bin[i >> 5] = (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i % 32);
}

Loading…
Cancel
Save