Commit graph

12 commits

Author SHA1 Message Date
548ef52ab7 change api and fix incorrect caclulation
i changed the api to not have a global wasm instance anymore. now
initWasm returns a WASM instance you have to pass down to the functions.
i feel like this is the best as it means you wont deal with a race
condition if you're messing with it more then once at the same time,
like i'm doing with tests.

i also accounted for the height given as that was the original
calculation that the Blurhash C implmentation used, not width * width,
width * height.
2023-08-21 18:58:23 -07:00
c84aa5cb2c ignore the spec folder from the npm package 2023-08-15 14:31:45 -07:00
9a35c5bb50 fix a memory leak bug and add tests 2023-08-15 14:30:13 -07:00
986912c2aa make initial memory smaller and let it grow
i also enabled lto building which should make performance better.
2023-08-14 22:19:45 -07:00
f7bbb92d85 change up api, and bump down version
the api now requires you to call an async function initWasm to make the
functions work instead of using top level await. i also optimized the
wasm module to have O3 and fast-math (which the original blurhash
makefile had and the results do seem to be the same with the javascript
blurhash).

I also gave the wasm instance functions inside typescript types and i
fixed a bug where i didnt free the pointers in order so if you called
decode too many times, you will run out of memory.
2023-08-14 19:24:20 -07:00
bb4f5b32e8 remove test export.. 2023-08-12 02:37:15 -07:00
280c0f77af change package name to not publish to npm 2023-08-12 02:31:37 -07:00
e8c07671bc remove license field from package.json 2023-08-12 02:28:41 -07:00
7f8712427d remove old dependencies 2023-08-12 02:28:17 -07:00
f4c0ab818a fix prepublishOnly command 2023-08-12 02:27:46 -07:00
fa1ba48cb4 add a license 2023-08-12 02:21:16 -07:00
799a85c75d create a wasm js wrapper for blurhash 2023-08-12 02:14:14 -07:00