mirror of
https://github.com/kamyu1537/eamuse-card-wasm.git
synced 2024-11-23 19:40:57 +01:00
🔥 이전 js 코드 삭제
This commit is contained in:
parent
d140a3424a
commit
b3ed9cff83
@ -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);
|
||||
});
|
||||
});
|
||||
};
|
Loading…
Reference in New Issue
Block a user