1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-15 18:38:53 -05:00
Original: f911eca8d1
This commit is contained in:
Ryan Dahl 2019-01-24 13:14:03 -05:00
parent 441bc0982b
commit 73d5d7c680
2 changed files with 4 additions and 8 deletions

View file

@ -246,10 +246,7 @@ export async function writeFrame(frame: WebSocketFrame, writer: Writer) {
let header: Uint8Array; let header: Uint8Array;
const hasMask = frame.mask ? 0x80 : 0; const hasMask = frame.mask ? 0x80 : 0;
if (payloadLength < 126) { if (payloadLength < 126) {
header = new Uint8Array([ header = new Uint8Array([0x80 | frame.opcode, hasMask | payloadLength]);
0x80 | frame.opcode,
hasMask | payloadLength
]);
} else if (payloadLength < 0xffff) { } else if (payloadLength < 0xffff) {
header = new Uint8Array([ header = new Uint8Array([
0x80 | frame.opcode, 0x80 | frame.opcode,

View file

@ -64,7 +64,7 @@ export class Sha1 {
let code, let code,
index = 0, index = 0,
i, i,
start = this._start, start = this._start,
length = message.length || 0, length = message.length || 0,
blocks = this._blocks; blocks = this._blocks;
@ -369,8 +369,7 @@ export class Sha1 {
arrayBuffer() { arrayBuffer() {
this.finalize(); this.finalize();
return Uint32Array.of( return Uint32Array.of(this._h0, this._h1, this._h2, this._h3, this._h4)
this._h0, this._h1, this._h2, this._h3, this._h4 .buffer;
).buffer;
} }
} }