1.0.0 • Published 5 years ago

d8code v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

d8code

Encode binary data as a UTF-8 string that may compress efficiently.

It may be an interesting alternative to base64 and hex encoding to inline WebAssembly code in a Javascript module.

wasm-crypto

wasm-crypto mainly contains code. The data section is small.

uncompressedgzip -9brotli -9
non encoded2302046680756528
base64 encoded3069417853472305
hex encoded4604087335270044
d8 encoded2785237200965816
d8 encoded, pshift=352687587173765212

libsodium

libsodium mainly contains optimized code. The data section is small.

uncompressedgzip -9brotli -9
original1426517384767085
base64 encoded1902059146083944
hex encoded2853028400175940
d8 encoded1831148282171612

tanks

The Tanks game contains code, but also a solid amount of already compressed binary data.

Base64 encoding performs the best here, even though any kind of encoding should be avoided here.

uncompressedgzip -9brotli -9
original3773944375130367085
base64 encoded503192937962373765105
hex encoded754788842529534090581
d8 encoded616283446481974108294