mrhooray / crc-rs

Rust implementation of CRC(16, 32, 64) with support of various standards
Apache License 2.0
187 stars 49 forks source link

switch impls based on crate features for u8 as an example #101

Closed KillingSpark closed 1 year ago

KillingSpark commented 1 year ago

As a draft towards #93, and #92

This introduces three crate features which enable choosing the default implementations. The implementation is chosen based on the flag with the most hardware compatibility ( => the highest restrictions on memory usage)

1. NoTable takes precedence over both others
2. Bytewise takes precedence over Slice16 and is the default if no feature is selected
3. Slice16 is used only if no other features are selected
KillingSpark commented 1 year ago

@akhilles Any thoughts on this?

akhilles commented 1 year ago

Overall, LGTM. I think this is the right approach.

KillingSpark commented 1 year ago

I don't think there is anything left to do, aside from agreeing on the naming for the features

akhilles commented 1 year ago

LGTM, thanks for your patience!