JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q20212F
  • License MIT

得到CRC码

Package Exports

  • get-crc
  • get-crc/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (get-crc) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

快速开始

const crc = require("get-crc");

const buffer = new Buffer.from([
  0x02, 0x04, 0x18, 0x21, 0x11, 0x25, 0x08, 0x08, 0x54, 0x01, 0x57, 0x00, 0x36,
  0x00, 0x0b, 0xff, 0xb2, 0x00, 0x05, 0xff, 0xe8, 0x00, 0x04, 0xff, 0xe4, 0xff,
  0xe4,
]);
const reply = new Buffer.from([0x02, 0x05]);

console.log(crc.crc16Modbus(reply));