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

🐞 Return of digest() is not stable #151

Closed
IsaacDynamo opened this issue Apr 10, 2024 · 2 comments · Fixed by #153
Closed

🐞 Return of digest() is not stable #151

IsaacDynamo opened this issue Apr 10, 2024 · 2 comments · Fixed by #153
Assignees
Labels
Milestone

Comments

@IsaacDynamo
Copy link

Summary

Multiple calls to digest() don't return the same answers.

Reproducing the Issue

>>> import crc
>>> r = crc.Register(crc.Crc8.BLUETOOTH)
>>> r.init()
>>> r.update(b"Hello World!")
138
>>> r.digest()
81
>>> r.digest()
138
>>> r.digest()
81

Expected Behaviour

Expected multiple calls to digest() to return the same value.

Actual Behaviour

Return value flip-flops between two values.

Root Cause (optional)

I think it is caused by in-place reverse in digest(), L256-L257

@Nicoretti
Copy link
Owner

Hi @IsaacDynamo,

nice find 👍! Root cause also seems to be spot on.
Thanks for reporting this ❤️, I'll try to address this and provide a release as soon as possible.

best
Nico

@Nicoretti Nicoretti self-assigned this Apr 11, 2024
@Nicoretti Nicoretti added this to the 6.1.2 milestone Apr 11, 2024
@Nicoretti
Copy link
Owner

https://github.com/Nicoretti/crc/releases/tag/6.1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants