+ ------------ CRC-8 Legic checksums\r
+ -- Takes a hex string and calculates a crc8\r
+ Crc8Legic = function(s)\r
+ if s == nil then return nil end\r
+ if #s == 0 then return nil end\r
+ if type(s) == 'string' then\r
+ local utils = require('utils')\r
+ local asc = utils.ConvertHexToAscii(s)\r
+ local hash = core.crc8legic(asc)\r
+ return hash\r
+ end\r
+ return nil\r
+ end,\r
+ \r