Browse Source

Add wat2js command and instructions

master
Emil Bay 6 years ago
parent
commit
fddaf6c7c4
  1. 10
      README.md
  2. BIN
      blake2b.wasm
  3. 5
      package.json

10
README.md

@ -58,12 +58,18 @@ There is a browser example included in [example.html](example.html) and [example
The bulk of this module is implemented in WebAssembly in the [blake2b.wat](blake2b.wat) file.
The format of this file is S-Expressions that can be compiled to their binary WASM representation by doing
```
wat2wasm blake2b.wat -o blake2b.wasm
```
To build the thin Javascript wrapper for the WASM module use `wat2js`:
```
# also available as `npm run compile`
wast2wasm blake2b.wat -o blake2b.wasm
wat2js blake2b.wat -o blake2b.js
```
If you do not have `wast2wasm` installed follow the instructions here, https://github.com/WebAssembly/wabt
If you do not have `wat2wasm` installed follow the instructions here, https://github.com/WebAssembly/wabt
## License

BIN
blake2b.wasm

Binary file not shown.

5
package.json

@ -9,10 +9,11 @@
"devDependencies": {
"blake2b": "^1.2.0",
"browserify": "^14.4.0",
"tape": "^4.6.3"
"tape": "^4.6.3",
"wat2js": "^1.1.1"
},
"scripts": {
"compile": "wast2wasm blake2b.wat -o blake2b.wasm",
"compile": "wat2js blake2b.wat -o blake2b.js",
"demo": "browserify example.js > bundle.js",
"test": "tape test.js"
},

Loading…
Cancel
Save