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

Encapsulate crc16() to avoid global #566

Merged
merged 1 commit into from
Apr 1, 2021

Conversation

felipediel
Copy link
Collaborator

This helps us to avoid global, which is usually a code smell.

@felipediel felipediel merged commit 55ea00f into mjg59:dev Apr 1, 2021
felipediel added a commit to felipediel/python-broadlink that referenced this pull request Apr 26, 2021
felipediel added a commit to felipediel/python-broadlink that referenced this pull request Sep 12, 2021
* Rename calculate_crc16 to crc16

* Apply PEP-8 naming conventions

* Remove unnecessary import

* Accept any sequence type

* Remove unnecessary conversions

* Expose polynomial and initial value as kwargs

* Remove unnecessary bitwise operations

* Store the CRC-16 table for performance

* Add missing type hints

* Update docstring

* General improvements

Encapsulate crc16() to avoid global (mjg59#566)

Segregate CRC16.get_table() from CRC16.calculate() (mjg59#567)
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.

1 participant