diff --git a/build/konami-card.js b/build/konami-card.js index b81b477..eb9039c 100644 --- a/build/konami-card.js +++ b/build/konami-card.js @@ -1,3 +1,9 @@ +crypto.getRandomValues = (buf) => { + buf = Buffer.from(buf); + let bytes = crypto.randomBytes(buf.length); + buf.set(bytes); + return buf; +}; require('./wasm_exec'); const go = new Go(); @@ -8,17 +14,17 @@ const wasmInstance = new WebAssembly.Instance(wasmModule, go.importObject); go.run(wasmInstance).then(); module.exports.encode = function (nfcId) { - return new Promise(resolve => { + return new Promise((resolve) => { KONAMI_CARD_ENCODE(nfcId, function (result) { - resolve(result) - }) - }) + resolve(result); + }); + }); }; module.exports.decode = function (cardId) { - return new Promise(resolve => { + return new Promise((resolve) => { KONAMI_CARD_DECODE(cardId, function (result) { - resolve(result) - }) - }) + resolve(result); + }); + }); };