Skip to content

Instantly share code, notes, and snippets.

@astagi
Last active December 23, 2019 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astagi/0653596ba752d71365ad2af75b6a7b8a to your computer and use it in GitHub Desktop.
Save astagi/0653596ba752d71365ad2af75b6a7b8a to your computer and use it in GitHub Desktop.
R2D2
let calculateChk = (buff) => {
let ret = 0x00;
for (let i = 0 ; i < buff.length ; i++) {
ret += buff[i];
}
ret = ret & 255;
return (ret ^ 255);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment