Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CRC-32 elements & verification #108

Merged
merged 3 commits into from
Mar 30, 2023

Conversation

FreezyLemon
Copy link
Contributor

I found what made the tests from #106 fail: CRC elements aren't handled in the EBML header.

Changes:

  1. Add parse_binary_exact to get an exact amount of bytes in an array
  2. Add combinator-style functions to get the checksum from the input (fn crc) and to verify the data with the checksum (fn checksum)
    (2.5) Add the crc crate to calculate the checksum(s) as per the specification.
  3. Use these functions in ebml_header and sub_element

The complete error handling for CRC-32 is a bit more involved than just returning an error, but I'd say it's good enough for now.

Copy link
Member

@Luni-4 Luni-4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine for me! Thanks a lot!

@Luni-4 Luni-4 merged commit 0cf2e9f into rust-av:master Mar 30, 2023
@FreezyLemon FreezyLemon deleted the implement-crc-checking branch March 30, 2023 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants