calculateCRC32FromHex method
Calculate CRC32 int from hex file
Implementation
int calculateCRC32FromHex(IntelHex ihObject, [int? startAddr,int? endAddr]){
logger?.verbose('Calculate CRC32 From Hex');
List<int> list = [];
if (startAddr == null && endAddr == null){
Map hexDict = ihObject.todict();
for(dynamic addr in hexDict.keys){ //addr, byte in list(hex_dict.items()){
list.add(hexDict[addr]);
}
}
else{
for(int addr = startAddr!; addr < endAddr! + 1;addr++){ //addr in range(start_addr, end_addr + 1){
list.add(ihObject[addr]);
}
}
return getCrc32(list) & 0xFFFFFFFF;//binascii.crc32(bytearray(list)) & 0xFFFFFFFF;
}