-
Notifications
You must be signed in to change notification settings - Fork 48
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
Crc::new
doesn't need to require a 'static
Algorithm
reference
#68
Comments
Would #69 be sufficient for this? I can't really think of a use case where parameters other than |
I think originally when I opened this issue, I was trying to bruteforce an unknown CRC algorithm given data and the end result. In that case, every parameter can be unknown and needs to be constructed on the fly. But I agree that the |
@wwylele Did you find a way of doing it? I have a fairly similar use case. I also wasn't really sure how to get around passing in check and residue if you're cycling through and don't have those values pre calculated. |
@nathanaelg No, I didn't. I didn't finish that project for other reasons. |
If the list of possible algorithms is bounded, then could you create a const array of all the ones you want to test? Maybe with a const fn. |
This restricts how a program could construct a custom algorithm locally ands use it on the fly.
I noticed that the current internal of
Crc
holds the reference. Relaxing the lifetime meansCrc
would need a lifetime parameter as well, which is a breaking change unfortunately. An alternative way is to letCrc
clone the dataAlgorithm
has.The text was updated successfully, but these errors were encountered: