sodium-javascript
Advanced tools
Comparing version 0.7.2 to 0.7.3
/* eslint-disable camelcase */ | ||
var MessageChannel = global.MessageChannel | ||
if (MessageChannel == null) ({ MessageChannel } = require('worker' + '_threads')) | ||
@@ -9,6 +7,5 @@ function sodium_malloc (n) { | ||
const sink = new MessageChannel() | ||
function sodium_free (n) { | ||
sodium_memzero(n) | ||
sink.port1.postMessage(n.buffer, [n.buffer]) | ||
loadSink().port1.postMessage(n.buffer, [n.buffer]) | ||
} | ||
@@ -20,2 +17,12 @@ | ||
var sink | ||
function loadSink () { | ||
if (sink) return sink | ||
var MessageChannel = global.MessageChannel | ||
if (MessageChannel == null) ({ MessageChannel } = require('worker' + '_threads')) | ||
sink = new MessageChannel() | ||
return sink | ||
} | ||
module.exports = { | ||
@@ -22,0 +29,0 @@ sodium_malloc, |
{ | ||
"name": "sodium-javascript", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"description": "WIP - a pure javascript version of sodium-native", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
72705
2067