Skip to content

sfomuseum/rs-rxing-wasm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rs-rxing-wasm

This is an exploratory web application to decode barcodes using the rxing-core/rxing-wasm WebAssembly binary.

Building

git clone [email protected]:rxing-core/rxing-wasm.git /usr/local/src/rxing-wasm
cd /usr/local/src/rxing-wasm  

wasm-pack build --release --target web
wasm-opt pkg/rxing_wasm_bg.wasm -o pkg/rxing_wasm_bg-opt.wasm --enable-bulk-memory -O1 --inlining-optimizing --heap-store-optimization --optimize-casts -Oz -O4
mv pkg/rxing_wasm_bg-opt.wasm pkg/rxing_wasm_bg.wasm

cp pkg/rxing_wasm.js pkg/rxing_wasm_bg.wasm /usr/local/sfomuseum/rs-rxing-wasm/www/

Testing

To test the build you can use any old HTTP fileserver that supports CORS and customized mime type headers (if necessary). I like to use the aaronland/go-http-fileserver package because I wrote it but anything will do. For example:

> make debug
fileserver -root ./www -mimetype js=text/javascript -mimetype wasm=application/wasm -enable-cors
2025/02/21 11:21:25 Serving ./www and listening for requests on http://localhost:8080

See also

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published