| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 641b1bb commit 168020e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,8 +61,6 @@ function validateHandshake(requestKey, responseKey) { | |||
| 61 | 61 | } | |
| 62 | 62 | ||
| 63 | 63 | function encodeFrameHybi17(payload) { | |
| 64 | - var i; | ||
| 65 | - | ||
| 66 | 64 | const dataLength = payload.length; | |
| 67 | 65 | ||
| 68 | 66 | let singleByteLength; | |
@@ -71,7 +69,7 @@ function encodeFrameHybi17(payload) { | |||
| 71 | 69 | singleByteLength = kEightBytePayloadLengthField; | |
| 72 | 70 | additionalLength = Buffer.alloc(8); | |
| 73 | 71 | let remaining = dataLength; | |
| 74 | - for (i = 0; i < 8; ++i) { | ||
| 72 | + for (let i = 0; i < 8; ++i) { | ||
| 75 | 73 | additionalLength[7 - i] = remaining & 0xFF; | |
| 76 | 74 | remaining >>= 8; | |
| 77 | 75 | } | |
@@ -92,7 +90,7 @@ function encodeFrameHybi17(payload) { | |||
| 92 | 90 | ||
| 93 | 91 | const mask = Buffer.alloc(4); | |
| 94 | 92 | const masked = Buffer.alloc(dataLength); | |
| 95 | - for (i = 0; i < dataLength; ++i) { | ||
| 93 | + for (let i = 0; i < dataLength; ++i) { | ||
| 96 | 94 | masked[i] = payload[i] ^ mask[i % kMaskingKeyWidthInBytes]; | |
| 97 | 95 | } | |
| 98 | 96 | ||
@@ -147,7 +145,7 @@ function decodeFrameHybi17(data) { | |||
| 147 | 145 | case kEightBytePayloadLengthField: | |
| 148 | 146 | payloadOffset += 8; | |
| 149 | 147 | payloadLength = 0; | |
| 150 | - for (var i = 0; i < 8; ++i) { | ||
| 148 | + for (let i = 0; i < 8; ++i) { | ||
| 151 | 149 | payloadLength <<= 8; | |
| 152 | 150 | payloadLength |= data[2 + i]; | |
| 153 | 151 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments