There are errors(syntax and many more), when i convert a list into crc8 hash values. I want to convert a list into CRC8 hash values. Please have a look
import crc8
hash = crc8.crc8()
hash.update(b'123')
assert hash.hexdigest() == 'c0'
assert hash.digest() == b'\xc0'
This is the sample code to convert string into crc8 hash values. I want to convert a list into hash values. Each item in the list needs to be converted into hash values.
import crc8
list = b["ya123","hello123","nihao123"]
for i in list:
hash = crc8.crc8()
hash.update(i)
assert hash.hexdigest() == 'c0'
assert hash.digest() == b'\xc0'
Output of conversion should look like this
["0x66","0xBF","0x1A"]
The crc8 class requires bytes - not strings. Therefore:
Output:
Note:
Not sure why the expected output is as stated in the question
Alternative implementation: