@gabrielmaialva33/discord-video-stream
Advanced tools
Comparing version 0.7.6 to 0.7.7
import _sodium from 'libsodium-wrappers'; | ||
const { crypto_secretbox_easy: crypto } = _sodium; | ||
export const MAX_INT16BIT = 2 ** 16; | ||
@@ -114,3 +113,3 @@ export const MAX_INT32BIT = 2 ** 32; | ||
header, | ||
crypto(body, nonceBuffer, this._mediaUdp.mediaConnection.secretkey), | ||
_sodium.crypto_secretbox_easy(body, nonceBuffer, this._mediaUdp.mediaConnection.secretkey), | ||
nonceBuffer.subarray(0, 4), | ||
@@ -133,4 +132,4 @@ ]); | ||
encryptData(message, nonceBuffer) { | ||
return crypto(message, nonceBuffer, this._mediaUdp.mediaConnection.secretkey); | ||
return _sodium.crypto_secretbox_easy(message, nonceBuffer, this._mediaUdp.mediaConnection.secretkey); | ||
} | ||
} |
{ | ||
"name": "@gabrielmaialva33/discord-video-stream", | ||
"version": "0.7.6", | ||
"version": "0.7.7", | ||
"description": "Experiment for making video streaming work for discord self bots", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -9,2 +9,7 @@ import _sodium from 'libsodium-wrappers' | ||
let sodium = _sodium | ||
await (async () => { | ||
await _sodium.ready | ||
sodium = _sodium | ||
})() | ||
export class BaseMediaPacketizer { | ||
@@ -141,3 +146,3 @@ protected readonly _payloadType: number | ||
header, | ||
_sodium.crypto_secretbox_easy(body, nonceBuffer, this._mediaUdp.mediaConnection.secretkey), | ||
sodium.crypto_secretbox_easy(body, nonceBuffer, this._mediaUdp.mediaConnection.secretkey), | ||
nonceBuffer.subarray(0, 4), | ||
@@ -164,3 +169,3 @@ ]) | ||
encryptData(message: string | Uint8Array, nonceBuffer: Buffer): Uint8Array { | ||
return _sodium.crypto_secretbox_easy( | ||
return sodium.crypto_secretbox_easy( | ||
message, | ||
@@ -167,0 +172,0 @@ nonceBuffer, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
150305
4015