npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fuknando/easy-crc

v0.0.1

Published

A JavaScript CRC-8 MAXIM node module.

Downloads

1

Readme

EASY-CRC

npm npm Build Status GitHub

A pure JavaScript and zero dependencies cyclic redundancy check (CRC) node module.
It supports crc8, crc16 and crc32.

Installation

npm install --save easy-crc

Usage

There are three functions available respectively named crc8(), crc16() and crc32(). These functions take two arguments.
The first argument is a string with the name of the desired algorithm (below the list), and the second is the data on which you want to calculate crc. Data can be a string or a buffer.

const { crc8, crc16, crc32 } = require('easy-crc');

// CRC8
let data = '12345';
let checksum = crc8('CRC-8', data);

console.log(checksum.toString(16));// "cb"

// CRC16
data = Buffer.from([0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39]);
checksum = crc16('CCITT-FALSE', data);

console.log(checksum.toString(16));// "7d61"

// CRC32
data = 'Hello!';
checksum = crc32('CRC-32', data);

console.log(checksum.toString(16));// "9d2acc56"

Available algorithms

The follow algorithm names can be passed as first argument of respective crc8(), crc16() and crc32() methods.

CRC8

  • CRC-8
  • CDMA2000
  • DARC
  • DVB-S2
  • EBU
  • I-CODE
  • ITU
  • MAXIM
  • ROHC
  • WCDMA

CRC16

  • BUYPASS
  • CCITT-FALSE
  • ~~AUG-CCITT~~ not working at moment.
  • ARC
  • CDMA2000
  • DDS-110
  • DECT-R
  • DECT-X
  • DNP
  • EN-13757
  • GENIBUS
  • MAXIM
  • KERMIT
  • MCRF4XX
  • MODBUS
  • RIELLO
  • T10-DIF
  • TELEDISK
  • TMS37157
  • USB
  • X-25
  • XMODEM
  • CRC-A

CRC32

  • CRC-32
  • CRC-32C
  • CRC-32D
  • CRC-32Q
  • BZIP2
  • JAMCRC
  • MPEG-2
  • POSIX
  • XFER

Running tests

npm test