Coder Social home page Coder Social logo

faster-crc32's Introduction

Cyclic Redundancy Check - 32-bit

A simple CRC32 module that implements the 32-bit cyclic redundancy check, or CRC-32, checksum. This module operates at top performance speed with no dependencies.

Installation:

npm i faster-crc32

Usage

const
    CRC32 = require( 'faster-crc32' ),
    path  = require( 'path' );

console.log( new CRC32( path.resolve( './test.png' ) ) );

Construction:

const filename = './path/to/file.png';
const options  = {
    chunkSize: CRC32.MB,
    encoding: CRC32.HEX
};

const crc      = new CRC32( filename, options );

crc
    .then( console.log )
    .catch( console.error );

Returns: Array

Values: UInt32, HEX, OCTAL, DECIMAL, BINARY

Calculation sizes:

CRC32.WHOLE - calculates hash on entire file

CRC32.B - calculates hash on each byte

CRC32.KB - calculates hash on each kilobyte

CRC32.MB - calculates hash on each megabyte

CRC32.GB - calculates hash on each gigabyte

Calculation outputs:

CRC32.BINARY = sets output to binary

CRC32.OCTAL = sets output to octal

CRC32.DECIMAL = sets output to decimal

CRC32.HEX = sets output to hex

CRC32.INT = sets output to int

CLI:

CRC32 ./path/to/file.png

faster-crc32's People

Contributors

iskore avatar

Watchers

James Cloos avatar  avatar putipong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.