diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2020-07-14 15:24:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-14 15:24:17 -0400 |
| commit | cde4dbb35132848ffece59ef9cfaccff32347124 (patch) | |
| tree | cc7830968c6decde704c8cfb83c9185193dc698f /std/hash/sha1.ts | |
| parent | 9eca71caa1674c31f9cc5d4e86c03f10b59e0a00 (diff) | |
Use dprint for internal formatting (#6682)
Diffstat (limited to 'std/hash/sha1.ts')
| -rw-r--r-- | std/hash/sha1.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/std/hash/sha1.ts b/std/hash/sha1.ts index e55b5e8d3..6a79db27b 100644 --- a/std/hash/sha1.ts +++ b/std/hash/sha1.ts @@ -33,6 +33,7 @@ export class Sha1 { constructor(sharedMemory = false) { if (sharedMemory) { + // deno-fmt-ignore blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; this.#blocks = blocks; } else { @@ -70,6 +71,7 @@ export class Sha1 { if (this.#hashed) { this.#hashed = false; blocks[0] = this.#block; + // deno-fmt-ignore blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; } @@ -90,8 +92,7 @@ export class Sha1 { blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3]; blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3]; } else { - code = - 0x10000 + + code = 0x10000 + (((code & 0x3ff) << 10) | (msg.charCodeAt(++index) & 0x3ff)); blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3]; blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3]; @@ -134,6 +135,7 @@ export class Sha1 { this.hash(); } blocks[0] = this.#block; + // deno-fmt-ignore blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; } blocks[14] = (this.#hBytes << 3) | (this.#bytes >>> 29); |
