I use the library by the simple code:
var crc8 = require("crc8").connect(); var dt = '{"ab":22}'; var codeddt = crc8.encode(dt); // > {"ab":22}212#135 var decdt = crc8.decode(codeddt); console.log("crc8 Report = ", decdt); // > crc8 Report = {"ab":22} if (decdt.indexOf("CRC") > 0 ){ return; } else { // yours code }
@IgorKandaurov started
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.
I use the library by the simple code: