crashdemons / fnv512-wasm Goto Github PK
View Code? Open in Web Editor NEWThis project forked from tweqx/python-fnv512
a WebAssembly implementation for the FNV-0/FNV-1/FNV-1A 512 bits hashing algorithms
License: GNU General Public License v3.0
This project forked from tweqx/python-fnv512
a WebAssembly implementation for the FNV-0/FNV-1/FNV-1A 512 bits hashing algorithms
License: GNU General Public License v3.0
fnv512.digestHex increases the total heap allocations by 1, but it should be releasing them.
Some test results when trying to trace the cause:
Initial reproducer:
open demo with memoryprofiler: 2 heap pointers malloc'd by emscripten
fnv512.digestHex("X",512,fnv512.variants.FNV_VARIANT_1A)
: 5 mallocs / 2 frees (+1 allocated heap pointer
Total possible heap increase: 1
C++ code behavior: (from code analysis)
init: malloc context (+1)
update: none (0)
finalRaw: none (0)
finalHex: none (0)
cleanup: free context (-1)
Total possible heap increase: 0
JS standard methods: (from code analysis)
init: none (0)
update: malloc buffer, free buffer (+1,-1)
updateFromValue: none (0)
final: malloc buffer, free buffer (+1,-1)
cleanup: none (0)
Total possible heap increase: 0
JS standard methods: (from actual testing)
(2 heap pointers initially opened by emscripten before running any functions)
c = fnv512.init(512,fnv512.variants.FNV_VARIANT_1A);
//3/0 (2 initial + context)
fnv512.update(c,new Uint8Array(2));
// N+3/N (only 3 alive: 2 initial + context)
fnv512.final(c);
// N+3/N no change (only 3 alive: 2 initial + context)
fnv512.cleanup(c);
// N+2/N (only 2 initial pointers alive)
(2 heap pointers open - emscripten)
Total heap increase: 0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.