Skip to content

Commit

Permalink
Apply code formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Nov 2, 2024
1 parent 89d4a11 commit 85e18b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
37 changes: 18 additions & 19 deletions src/crc/_crc.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,21 +486,20 @@ class Crc8(enum.Enum):
reverse_input=False,
reverse_output=False,
)
'''
"""
:Alias: ATM
'''
"""

ROHC = Configuration(
width=8,
polynomial=0x07,
init_value=0xff,
init_value=0xFF,
final_xor_value=0x00,
reverse_input=True,
reverse_output=True,
)



@enum.unique
class Crc16(enum.Enum):
XMODEM = Configuration(
Expand All @@ -511,9 +510,9 @@ class Crc16(enum.Enum):
reverse_input=False,
reverse_output=False,
)
'''
"""
:Alias: ZMODEM,ACORN
'''
"""

GSM = Configuration(
width=16,
Expand Down Expand Up @@ -550,9 +549,9 @@ class Crc16(enum.Enum):
reverse_input=False,
reverse_output=False,
)
'''
"""
:Alias: CCITT_FALSE
'''
"""

KERMIT = Configuration(
width=16,
Expand All @@ -562,10 +561,10 @@ class Crc16(enum.Enum):
reverse_input=True,
reverse_output=True,
)
'''
"""
:Alias: CCITT
'''
"""

IBM = Configuration(
width=16,
polynomial=0x8005,
Expand All @@ -574,33 +573,33 @@ class Crc16(enum.Enum):
reverse_input=True,
reverse_output=True,
)
'''
"""
:Alias: ARC,LHA
'''
"""

MAXIM = Configuration(
width=16,
polynomial=0x8005,
init_value=0x0000,
final_xor_value=0xffff,
final_xor_value=0xFFFF,
reverse_input=True,
reverse_output=True,
)

USB = Configuration(
width=16,
polynomial=0x8005,
init_value=0xffff,
final_xor_value=0xffff,
init_value=0xFFFF,
final_xor_value=0xFFFF,
reverse_input=True,
reverse_output=True,
)

X25 = Configuration(
width=16,
polynomial=0x1021,
init_value=0xffff,
final_xor_value=0xffff,
init_value=0xFFFF,
final_xor_value=0xFFFF,
reverse_input=True,
reverse_output=True,
)
Expand All @@ -609,7 +608,7 @@ class Crc16(enum.Enum):
width=16,
polynomial=0x3D65,
init_value=0x0000,
final_xor_value=0xffff,
final_xor_value=0xFFFF,
reverse_input=True,
reverse_output=True,
)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_crc.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def test_cr16_x25(self):
crc_register.init()
crc_register.update(test.data.encode("utf-8"))
self.assertEqual(test.checksum, crc_register.digest())

def test_cr16_dnp(self):
config = Crc16.DNP
for register_type in self._register_types:
Expand Down

0 comments on commit 85e18b9

Please sign in to comment.