Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 696 Bytes

README.md

File metadata and controls

29 lines (17 loc) · 696 Bytes

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)