From f790621e600826ad283ee4942adb229246a37a9b Mon Sep 17 00:00:00 2001 From: Mathias Buus Date: Wed, 4 Mar 2020 14:50:09 +0100 Subject: [PATCH] add sodium_malloc --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index c7af053..c7b26de 100644 --- a/index.js +++ b/index.js @@ -1851,6 +1851,10 @@ sodium.crypto_box_keypair = crypto_box_keypair sodium.crypto_box_seal = crypto_box_seal sodium.crypto_box_seal_open = crypto_box_seal_open +sodium.sodium_malloc = function (n) { + return new Uint8Array(n) +} + function cleanup(arr) { for (var i = 0; i < arr.length; i++) arr[i] = 0; }