@aircast-4g/mavlink
Version:
TypeScript type generator for MAVLink dialects
2 lines (1 loc) • 399 B
JavaScript
const t=65535;class a{static calculate(t,a){let e=65535;for(let a=0;a<t.length;a++){let l=t[a]^255&e;l=255&(l^l<<4),e=65535&(e>>8^l<<8^l<<3^l>>4)}let l=a^255&e;return l=255&(l^l<<4),e=65535&(e>>8^l<<8^l<<3^l>>4),e}static validate(t,a,e){return this.calculate(t,a)===e}static validateWithTable(t,a,e,l){const c=l[a];return void 0!==c&&this.validate(t,c,e)}}export{a as MAVLinkCRC,t as X25_INIT_CRC};