parameters.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # vim: ts=8 sw=8 noexpandtab
  2. #
  3. # CRC code generator
  4. #
  5. # Copyright (c) 2019-2023 Michael Büsch <m@bues.ch>
  6. #
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License along
  18. # with this program; if not, write to the Free Software Foundation, Inc.,
  19. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. #
  21. __all__ = [
  22. "CRC_PARAMETERS",
  23. ]
  24. CRC_PARAMETERS = {
  25. "CRC-64-ECMA" : {
  26. "polynomial" : 0xC96C5795D7870F42,
  27. "nrBits" : 64,
  28. "shiftRight" : True,
  29. },
  30. "CRC-64-ISO" : {
  31. "polynomial" : 0xD800000000000000,
  32. "nrBits" : 64,
  33. "shiftRight" : True,
  34. },
  35. "CRC-32" : {
  36. "polynomial" : 0xEDB88320,
  37. "nrBits" : 32,
  38. "shiftRight" : True,
  39. },
  40. "CRC-16" : {
  41. "polynomial" : 0xA001,
  42. "nrBits" : 16,
  43. "shiftRight" : True,
  44. },
  45. "CRC-16-CCITT" : {
  46. "polynomial" : 0x1021,
  47. "nrBits" : 16,
  48. "shiftRight" : False,
  49. },
  50. "CRC-8-CCITT" : {
  51. "polynomial" : 0x07,
  52. "nrBits" : 8,
  53. "shiftRight" : False,
  54. },
  55. "CRC-8-IBUTTON" : {
  56. "polynomial" : 0x8C,
  57. "nrBits" : 8,
  58. "shiftRight" : True,
  59. },
  60. "CRC-6-ITU" : {
  61. "polynomial" : 0x03,
  62. "nrBits" : 6,
  63. "shiftRight" : False,
  64. },
  65. }