vovagorodok / ArduinoBleOTA

Upload firmware over Bluetooth
MIT License
24 stars 8 forks source link

which crc lib? #27

Closed sdetweil closed 1 year ago

sdetweil commented 1 year ago

I am looking for a working crc for nodejs app.

the one I have produces different results with running crc like python code and one time like flutter app. and different than bleota code version

vovagorodok commented 1 year ago

BleOta uses default CRC32 calculation. Find nodejs library with that

sdetweil commented 1 year ago

thanks. first two produce different results...

vovagorodok commented 1 year ago

Hmm, am I understand correctly uploader.sh and flutter app has different crc result for same binary?

sdetweil commented 1 year ago

correctly uploader.sh and flutter app has different crc result for same binary no, you just use two different approaches, flutter is from one buffer, uploader is incremental

man this is harder than it should be

download the same file from the same server, wrote a node test app

same crc as your lib your lib gets the data from my app (so that is good) my app calculates from full data (like you flutter app) like the node test app

node test app 226795867 your lib 226795867

my app BEFORE sending the data 3074055154, technically the crc lib returns signed number -1220912142

finally had to embed in source https://stackoverflow.com/questions/18638900/javascript-crc32

sdetweil commented 1 year ago

working