Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 8 lines (7 sloc) 182 Bytes
#!/bin/sh
# Usage: ./wasm2cb.sh <filename>.wasm
out=""
for x in $(xxd -ps -c1 $1)
do out="$out,$(( 16#$x ))"
done
echo $out|sed "s/^,\(.*\)$/var wasmCode = new Uint8Array([\1]);/"