This module contains functions for calculating CRCs as defined in the CD-DA and CD-ROM standards.
The CD standards use CRCs (cyclic redundancy checks) as a way to allow a player to check for corruption of low-level metadata. Since CDs are a physical medium that can suffer from scratches, dust, and other damage, it's important to be able to know that playback metadata is actually accurate before trying to read it.
The CD-DA and CD-ROM standards use two types of CRC functions in different parts of each sector:
- A 32-bit CRC within the error correction metadata located within each sector.
- A 16-bit CRC within the second subcode.
This crate currently only provides the 16-bit CRC.
This crate incorporates an adaptation of a CRC function from the Ruby crc gem by dearblue.
Calculates a 16-bit CRC for the supplied data.
This is the form of CRC used by the CD standard's Q subcode data.