From b3ed9cff83a434a1b0a2c1806d537d70699f0e11 Mon Sep 17 00:00:00 2001 From: Byeon Seongun Date: Wed, 6 May 2020 16:17:18 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20=EC=9D=B4=EC=A0=84=20js=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/konami-card.js | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 build/konami-card.js diff --git a/build/konami-card.js b/build/konami-card.js deleted file mode 100644 index eb9039c..0000000 --- a/build/konami-card.js +++ /dev/null @@ -1,30 +0,0 @@ -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(); -const path = require('path').join(__dirname, 'konami-card.wasm'); -const bytes = require('fs').readFileSync(path); -const wasmModule = new WebAssembly.Module(bytes); -const wasmInstance = new WebAssembly.Instance(wasmModule, go.importObject); -go.run(wasmInstance).then(); - -module.exports.encode = function (nfcId) { - return new Promise((resolve) => { - KONAMI_CARD_ENCODE(nfcId, function (result) { - resolve(result); - }); - }); -}; - -module.exports.decode = function (cardId) { - return new Promise((resolve) => { - KONAMI_CARD_DECODE(cardId, function (result) { - resolve(result); - }); - }); -};