Skip to content

A Cyclic Redundancy Check (CRC) library for Ruby (Hex input support)

License

Notifications You must be signed in to change notification settings

chenqingspring/digest-crc

 
 

Repository files navigation

Forked from digest-crc

Add Digest::CRC32MpegByHex module for calculating crc32mpeg by hex input

Install

Add to Gemfile


gem 'digest-crc', github: 'chenqingspring/digest-crc'

New Usage

Calculate a CRC32 Mpeg by hex:

require 'digest/crc32_mpeg_by_hex'

Digest::CRC32MpegByHex.hexdigest('0100010201050102')
# => "badbdb6f"

Double check results by http://crccalc.com/?crc=0100010201050102&method=crc32&datatype=hex

Other CRC algorithms Supporting

To making other algorithm support hex input, just change update method, replace reading each_byte of string to scan hex stream in every 8 bit (1 byte)(2 hex)

About

A Cyclic Redundancy Check (CRC) library for Ruby (Hex input support)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%