New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

modes-crc

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modes-crc

A parity checker for ModeS transpoder messages

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

Mode-S CRC Checker

A CRC implementation for ADS-B Mode-S messages

Build Status

npm package

Installation

$ npm install --save modes-crc

Documentation

Checker

  • checksum
  • crc

Fixer

Checker

### checksum(data, [bits])

Calculates the checksum of the data frame passed to it, based on the parity table provided.

### crc(data, [bits])

Extracts the CRC value from a data frame last 3 bytes.

Fixer

### fix(data, [bits])

Tries to fix a single bit on a message by transversing it and xor'ing each bit and comparing that new message checksum with the original CRC value.

Quick Examples

Pass it a buffer to the actual ADSB packet and the number of bits in the packet.

var checker = require('modes-crc')

var data = [93, 77, 32, 35, 122, 85, 166]

var packetChecksum = checker.checksum(data, checker.MODES_SHORT_MSG)

It will do a parity check and output a checksum that should be equal to the result of the packet CRC obtained by

var checker = require('modes-crc')

var data = [93, 77, 32, 35, 122, 85, 166]

var packetCrc = checker.crc(data, checker.MODES_SHORT_MSG)

Credits

A port of antirez's dump1090, but in Node.js: https://github.com/antirez/dump1090/

License

Keeps the 3-Clause BSD License from the "parent" repository

Keywords

adsb

FAQs

Package last updated on 26 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts