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

Allow users to specify both ref_in and ref_out when creating Digests. #45

Closed
zachmse opened this issue Jul 20, 2019 · 1 comment
Closed

Comments

@zachmse
Copy link
Contributor

zachmse commented Jul 20, 2019

In the comments of #37, the ability to specify both ref_in and ref_out was discussed. I also think this capability would be good to add. If this change is made, I think it would be good to update the implementations of Digest to follow the builder pattern, rather than adding even more parameters to the new_custom() function. In fact, as the new_custom() function hasn't been included in a release yet (as far as I can tell), it could even be removed.

For example, I envision something like the following:

// Anything not explicitly set is given a "sane" default value
let mut digest = crc16::Digest::new(poly)
    .initial_crc(crc)
    .reflection_in(true)
    .reflection_out(true);

Ultimately I don't have a strong preference on how these values are set, so feel free to "no change" this issue, but I would be more than happy to prototype the changes if this is something that might be wanted.

@mrhooray
Copy link
Owner

closing as #55 has been merged

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

No branches or pull requests

2 participants