Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
executable file 7 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]);/"