1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-03 12:58:54 -05:00
This commit is contained in:
Ryan Dahl 2019-01-24 13:14:03 -05:00
parent e87cd44033
commit f911eca8d1
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

@ -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;
} }
} }