mirror of
https://github.com/arnaucube/shamirsecretsharing.git
synced 2026-02-07 11:36:46 +01:00
add html and js to interact with the wasm lib, add server serving wasm lib mime type, wasm wrapper print shares result into document
This commit is contained in:
23
wasm/index.html
Normal file
23
wasm/index.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>shamirsecretsharing wasm</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="wasm_exec.js"></script>
|
||||
<script>
|
||||
const go = new Go();
|
||||
WebAssembly.instantiateStreaming(fetch('shamirsecretsharing.wasm'), go.importObject).then(function(dat) {
|
||||
go.run(dat.instance);
|
||||
});
|
||||
</script>
|
||||
<input id="secret" value="123456789" />
|
||||
<input id="nShares" value="5"/>
|
||||
<input id="nNeededShares" value="3"/>
|
||||
<input id="p" value="7"/>
|
||||
<button onClick="callCreateShares();">Create Shares</button>
|
||||
<textarea id="sharesResult" rows="10" style="width: 80%;">
|
||||
</textarea>
|
||||
<script src="index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user