aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/p2p-media-loader/segment-validator.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-17 14:42:53 +0200
committerChocobozzz <me@florianbigard.com>2021-08-18 08:35:06 +0200
commit9df52d660feb722404be00a50f3c8a612bec1c15 (patch)
treedde52880fa012874d24c60f64eb596b0a789cc8b /client/src/assets/player/p2p-media-loader/segment-validator.ts
parentadb8809d43648ea0a64d6845bb39aa3bd0e005a6 (diff)
downloadPeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.gz
PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.tar.zst
PeerTube-9df52d660feb722404be00a50f3c8a612bec1c15.zip
Migrate client to eslint
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.ts5
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}