Skip to content

Conversation

jasagredo
Copy link
Contributor

No description provided.

@jasagredo jasagredo requested a review from a team as a code owner September 16, 2025 08:59
Copy link
Contributor

@jorisdral jorisdral left a comment

Choose a reason for hiding this comment

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

What's the motivation for this change? I'm not opposed, just wondering

BTW, this is definitely a breaking change, no? So we'd need a changelog entry to that effect. And could changing checksums unexpectedly break things in ouroboros-consensus? Does it break the ImmutableDB (IIRC that's where checksums are used)?

, containers ^>=0.5 || ^>=0.6 || ^>=0.7
, deepseq ^>=1.4 || ^>=1.5
, digest ^>=0.0
, crc32c
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have a strict upper and lower bound (or caret operator)

Comment on lines +65 to +66
instance CRC32C [Word8] where
crc32cUpdate n = (crc32cUpdate n) . BL.pack
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this instance used anywhere?

Comment on lines +68 to +71
instance CRC32C BSS.ShortByteString where
crc32c = crc32c . BSS.fromShort

computeCRC :: forall a. Digest.CRC32 a => a -> CRC
computeCRC = coerce (Digest.crc32 :: a -> Word32)
crc32cUpdate cks = crc32cUpdate cks . BSS.fromShort
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be optimised to work on the short bytestring directly

Comment on lines +12 to +14
computeCRC,
initCRC,
updateCRC,
Copy link
Contributor

@jorisdral jorisdral Sep 16, 2025

Choose a reason for hiding this comment

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

updateCRC and computeCRC reference the new CRC32C class but the class isn't exposed. Do we really need a new class? I think we only really need to compute crc's on bytestrings, and those computations can be internal

@jasagredo jasagredo closed this Sep 16, 2025
@jasagredo jasagredo deleted the js/crc32c branch September 16, 2025 11:18
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