mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-16 11:28:18 +00:00
Sodium (#1172)
* Use Native libsodium when available * add newline * fix typo of exports * add to webpack ignore * Update Secretbox.js
This commit is contained in:
committed by
Schuyler Cebulskie
parent
02c23a8b53
commit
49944747ae
@@ -0,0 +1,13 @@
|
||||
try {
|
||||
const sodium = require('sodium');
|
||||
module.exports = {
|
||||
open: sodium.api.crypto_secretbox_open,
|
||||
close: sodium.api.crypto_secretbox,
|
||||
};
|
||||
} catch (err) {
|
||||
const tweetnacl = require('tweetnacl');
|
||||
module.exports = {
|
||||
open: tweetnacl.secretbox.open,
|
||||
close: tweetnacl.secretbox,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user