title: Call a libsodium function with callback value
body: <p>I try to hash and store a password into a database.
  So I use libsodium with crypto_pwhash into a node app.
  I create a function, export it, but I can not received the hash password.</p>
  
  <p>Here is my code :
  sodium.js</p>
  
  <pre><code>libsodium = require('libsodium-wrappers-sumo');
   (async() =&gt; {
  await libsodium.ready;
  const sodium = libsodium;
  
  module.exports.password_hash = function(password, res){
  var hashed_password = [sodium.crypto_pwhash_STRBYTES];
   if (sodium.crypto_pwhash_str ( sodium.crypto_pwhash_MEMLIMIT_SENSITIVE) != 0){
     /* out of memory */
  }
     return res(hashed_password);
  }
  /*if (sodium.crypto_pwhash_str_verify
  (hashed_password, PASSWORD, strlen(PASSWORD)) != 0) {
  /* wrong password */
  //}
  })();
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>sodium.password_hash("test", function(res){
          console.log(res);  
       });
  </code></pre>
  
  <p>The error message is : unsupported input type for password.</p>
  
  <p>I don't understand what is wrong </p>
  
  <p>Update: i updade my code,
  now the message error is : When defined, the output format must be a string
  I think it is an issue with the array</p>