-
Notifications
You must be signed in to change notification settings - Fork 1
/
esm.html
39 lines (31 loc) · 765 Bytes
/
esm.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESM</title>
<style>
html {
font-family: sans-serif;
background-color: #000;
}
</style>
</head>
<body>
<!--
Add the following polyfill for Microsoft Edge 17/18 support:
<script src="https://cdn.jsdelivr.net/npm/text-encoding@0.7.0/lib/encoding.min.js"></script>
(see https://caniuse.com/#feat=textencoder)
-->
<script type="module">
import {init, add} from '../node_modules/cross-wasm/dist/index.esm.js';
const run = async () => {
await init();
// 223
console.log('add res', add(1, 222))
// 47173285a8d7341e5e972fc677286384f802f8ef42a5ec5f03bbfa254cb01fad
console.log( 'Keccak256 res:', Keccak256('hello world') )
}
run();
</script>
</body>
</html>