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

crclib

v1.0.1

Published

This library allows you to calculate CRC for different types of keys

Downloads

16

Readme

CRCLIB - Lib for calculate CRC

Данная библеотека позволяет вам рассчитать контрольную сумму для таких ключей как: Dallas, ТехКом (включая ТК17), КТ-01, Mifare (включая алгоритм расчета с 3 байтами), Urmet.

Список методов:

texkom(<ByteArray>) // Контрольная сумма ТехКом (ТК-13, ТК-15)
kt01(<ByteArray>) // Контрольная сумма КТ-01
dallas(<ByteArray>) // Контрольная сумма Dallas
tk17(<ByteArray>) // Контрольная сумма ТехКом ТК-17
mifare(<ByteArray>) // Контрольная сумма Mifare (4 байта)
mifare3(<ByteArray>) // Контрольная сумма Mifare (3 байта)
urmet(<ByteArray>) // Контрольная сумма Urmet
fixHid37(<ByteArray>) // Фикс неправильного кода для HID37
fixPAC(<ByteArray>) // Фикс неправильного кода для PAC
fixMetakomByte(<Byte>) // Фикс кода в соотвествии с документацией чипа 1233КТ2

test() // Проверка всех алгоритмов

Пример:

var crclib = require("crclib")

var crc = new crclib()

console.log(`ТехКом: ` + this.texkom([0x00, 0x32, 0x32, 0x44, 0x55, 0x63, 0xFF, 0xFF]) ) // -> 5A
console.log(`КТ-01: ` + this.kt01([0x00, 0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34]) ) // -> 44
console.log(`Dallas: ` + this.dallas([0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01]) ) // -> 9B
console.log(`ТехКом ТК-17: ` + this.tk17([0x00, 0x32, 0x32, 0x44, 0x55, 0xCA, 0xFF, 0xFF]) ) // -> 48
console.log(`Mifare: ` + this.mifare([0xAA, 0xBB, 0xCD, 0xEF]) ) // -> 33
console.log(`Mifare: ` + this.mifare3([0xAA, 0xBB, 0xCC]) ) // -> 55
console.log(`HID37: ` + this.fixHid37([0x56, 0x5A, 0x11, 0x40, 0xBE]) ) // -> 07,5A,11,40,BE
console.log(`Urmet: ` + this.urmet([0xF2, 0x00, 0x00, 0x98, 0x76, 0x54, 0x32])) // -> D2
console.log(`PAC: ` + this.fixPAC([0x12, 0x21, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x12, 0x34, 0x56, 0x78, 0x90, 0x00, 0x00, 0x00]))
console.log(`METAKOM: 9AD1E1` + this.fixMetakomByte(0x9AD1E1D0)) // -> 9AD1E1D1

Если нашли ошибку или у вас есть вопросы пожалуйста напишите мне

For foreigners

Sorry, I'm lazy and English docs is not ready