diff options
Diffstat (limited to 'client/src/assets/player/p2p-media-loader/segment-validator.ts')
-rw-r--r-- | client/src/assets/player/p2p-media-loader/segment-validator.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/client/src/assets/player/p2p-media-loader/segment-validator.ts b/client/src/assets/player/p2p-media-loader/segment-validator.ts index d0a4c4a3f..f7f83a8a4 100644 --- a/client/src/assets/player/p2p-media-loader/segment-validator.ts +++ b/client/src/assets/player/p2p-media-loader/segment-validator.ts | |||
@@ -86,6 +86,7 @@ async function sha256Hex (data?: ArrayBuffer) { | |||
86 | 86 | ||
87 | // Fallback for non HTTPS context | 87 | // Fallback for non HTTPS context |
88 | const shaModule = (await import('sha.js') as any).default | 88 | const shaModule = (await import('sha.js') as any).default |
89 | // eslint-disable-next-line new-cap | ||
89 | return new shaModule.sha256().update(Buffer.from(data)).digest('hex') | 90 | return new shaModule.sha256().update(Buffer.from(data)).digest('hex') |
90 | } | 91 | } |
91 | 92 | ||
@@ -97,7 +98,9 @@ function bufferToHex (buffer?: ArrayBuffer) { | |||
97 | const h = '0123456789abcdef' | 98 | const h = '0123456789abcdef' |
98 | const o = new Uint8Array(buffer) | 99 | const o = new Uint8Array(buffer) |
99 | 100 | ||
100 | o.forEach((v: any) => s += h[ v >> 4 ] + h[ v & 15 ]) | 101 | o.forEach((v: any) => { |
102 | s += h[v >> 4] + h[v & 15] | ||
103 | }) | ||
101 | 104 | ||
102 | return s | 105 | return s |
103 | } | 106 | } |