@Kolban the guys from nodemcu had the same problem and fixed it. Heap doubled from one day to the other. @Gordon source is available here http://jumspruino.jumware.com/sources/SHA1.js.
I did some (crazy) things to reduce memory and speed, which did not make it easier to read:
use typed arrays
remove temporary values
replace switch by if...elseif...
removed functions and added code inline
reuse local vars
converted multiplication(like *4, *32,..) to shift
removed a "funny" encode64 and use btoa instead
moved functions to be local
All together my plan is to use ESP8266 for web, and let Espruino boards do the hard work.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Kolban the guys from nodemcu had the same problem and fixed it. Heap doubled from one day to the other.
@Gordon source is available here http://jumspruino.jumware.com/sources/SHA1.js.
I did some (crazy) things to reduce memory and speed, which did not make it easier to read:
All together my plan is to use ESP8266 for web, and let Espruino boards do the hard work.