4 sys
.path
.insert(0, os
.getcwd())
6 sys
.stdout
= open(sys
.argv
[1], "w")
8 import liba
# type: ignore
14 assert crc(text
) == 0x45
15 assert crc(crc
.pack(text
)) == 0
17 crc
= liba
.crc8(0x31, reversed=True)
19 assert crc(text
) == 0x75
20 assert crc(crc
.pack(text
)) == 0
22 crc
= liba
.crc16(0x1021)
24 assert crc(text
) == 0x9C58
25 assert crc(crc
.pack(text
)) == 0
27 crc
= liba
.crc16(0x8005, reversed=True)
29 assert crc(text
) == 0x443D
30 assert crc(crc
.pack(text
)) == 0
32 crc
= liba
.crc32(0x1EDC6F41)
34 assert crc(text
) == 0x512B456E
35 assert crc(crc
.pack(text
)) == 0
37 crc
= liba
.crc32(0x04C11DB7, reversed=True)
39 assert crc(text
) == 0x450EAFB0
40 assert crc(crc
.pack(text
)) == 0
42 crc
= liba
.crc64(0x000000000000001B)
44 assert crc(text
) == 0xE4FFBEA588AFC790
45 assert crc(crc
.pack(text
)) == 0
47 crc
= liba
.crc64(0x42F0E1EBA9EA3693, reversed=True)
49 assert crc(text
) == 0xDA60676A5CDE0008
50 assert crc(crc
.pack(text
)) == 0