Skip to content

Commit

Permalink
add wasm as base64string for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
stutxo committed Apr 2, 2024
1 parent 98558ba commit edf9ebd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ echo "Build complete! 🎉 ${BASE64_WASM: -10}"
# Output the file size

ls -lh target/wasm32-unknown-unknown/release/blockwars.wasm | awk '{print "\033[0;95mwasm size: " $5 "\033[0m"}'
ls -lh docs/index.html | awk '{print "\033[0;91mindex.html size: " $5 "\033[0m"}'
4 changes: 3 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
</div>
</div>
<script>
// Base64WasmStart
//This is a base64 encoded WebAssembly binary, it is 33% bigger than the original .wasm binary, im just testing it out.

// Base64WasmStart
const base64Wasm = 'AGFzbQEAAAABCAJgAABgAX8AAwQDAAEABQMBABQGGQN/AEHEgsAAC38AQcjyzwALfwBB0PLPAAsHTwcGbWVtb3J5AgALa2V5X3ByZXNzZWQAAARzZWVkAAEJZ2FtZV9sb29wAAIGQlVGRkVSAwAKX19kYXRhX2VuZAMBC19faGVhcF9iYXNlAwIKzwsDDABBuYLAAEEBOgAACwwAQcCCwAAgADYCAAuyCwEUf0G8gsAAQbyCwAAoAgAiAEEBajYCAAJAIAANAEHAgsAAKAIAQQFqIgBBDXQgAHMiAEERdiAAcyIAQQV0IABzIgxBDXQgDHMiAEERdiAAcyIAQQV0IABzIgBBDXQgAHMiAkERdiACcyICQQV0IAJzIgRBEXAiCEERbCAAQRFwIgJqQZiAwABqQQE6AAAgDEEHcEECaiELQQAhAANAIAJBD2whDSAIQQ9sIQ4gCEEFaiEPIAJBBWohEANAIAAgCyAAIAtLGyERQQggACAAQQhNGyISQQFqIQoDQCAAIBFGBEAgDEEDbCAMQQduQRVsa0GIgMAAaiEBA0AgC0EHSw0FIAFBADoAACABQQNqIQE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0NAQsgACAHIAhqOgAACyACIANJDQIgAiADTQ0FIAAgAkEFazoAAQwFCyAAQQA6AAIgACADOgABIAAgCToAACAFQQI6AAIgBEEHRg0DIARBA2xBhYDAAGoiAC0AAA0CDAMLA0AMAAsACyAAIAJBBWo6AAEMAgsgAEEDOgAAC0G5gsAAQQA6AAALQfyPcCEBA38gAQR/IAFByPLPAGpBADYCACABQQRqIQEMAQVBAAsLIQcDQAJAIAdBGEcEQEEAIQIgB0GCgMAAai0AAEEBa0H/AXEiAEEBakEAIABBA0kbIQAgB0GBgMAAai0AACEDIAdBgIBAay0AACEIA0AgAkEPRg0CIAIgA2pB/wFxQf8BbCEJQQAhAQNAIAFBD0cEQCAJIAEgCGpB/wFxaiIFQYD8A00EQCAFQQJ0QcSCwABqIAA2AgALIAFBAWohAQwBCwsgAkEBaiECDAALAAsPCyAHQQNqIQcMAAsACw==';
// Base64WasmEnd
const canvas = document.getElementById('canvas');
Expand Down

0 comments on commit edf9ebd

Please sign in to comment.