Re: CHECKSUM CHALLENGE - (US$ 100)

> We're offering US$100 to have a checksum/CRC algorithm

> > reverse-engineered. > > #include > #include > > unsigned char samples[]={ > 0x06, 0xFF, 0x01, 0xFF, 0x09, 0xFF, 0x46, 0xFF, 0x36, 0xFF, 0xD8, 0xFF, > 0xF5, 0x06, 0xFF, 0x01, 0xFF, 0x09, 0xFF, 0x0A, 0xFF, 0x3C, 0xFF, 0xF1, > 0xFF, 0x95, 0x06, 0xFF, 0x01, 0xFF, 0x09, 0xFF, 0x7C, 0xFF, 0x2A, 0xFF, > 0xE0, 0xFF, 0xA3, 0x06, 0xFF, 0x01, 0xFF, 0x09, 0xFF, 0xA6, 0xFF, 0x36, > 0xFF, 0xD8, 0xFF, 0xC1, 0x06, 0xFF, 0x01, 0xFF, 0x09, 0xFF, 0xD6, 0xFF, > 0x2A, 0xFF, 0xDE, 0xFF, 0x5B, 0x06, 0xFF, 0x01, 0xFF, 0x07, 0xFF, 0x06, > 0xFF, 0x1E, 0xFF, 0x7D, 0xFF, 0xD7, 0x06, 0xFF, 0x01, 0xFF, 0x07, 0xFF, > 0x24, 0xFF, 0xF5, 0xFF, 0x23, 0xFF, 0x91, 0x06, 0xFF, 0x01, 0xFF, 0x08, > 0xFF, 0x80, 0xFF, 0x1E, 0xFF, 0x22, 0xFF, 0x9D, 0x06, 0xFF, 0x01, 0xFF, > 0x08, 0xFF, 0x9E, 0xFF, 0x42, 0xFF, 0x72, 0xFF, 0xC1 }; > > unsigned char carlos(unsigned char *buf) > { > size_t i; > > for (i=0; i { > if (memcmp(buf,samples+i,12) == 0) return *(samples+i+12); > } > return 0x58; > } > > int main(void) > { > unsigned char case_a[]={0x06, 0xFF, 0x01, 0xFF, 0x09, 0xFF, > 0x7C, 0xFF, 0x2A, 0xFF, 0xE0, 0xFF}; /* 0xA3 */ > unsigned char case_b[]={0x06, 0xFF, 0x01, 0xFF, 0x08, 0xFF, > 0x80, 0xFF, 0x1E, 0xFF, 0x22, 0xFF}; /* 0x9d */ > unsigned char case_c[]={'B', 'i', 'l', 'l', 'P', 'G', > '.', 'm', 'e', '.', 'u', 'k' }; /* 0x58 */ > > printf("carlos(case_a) == 0x%02x (exp 0xA3)\n",carlos(case_a)); > printf("carlos(case_b) == 0x%02x (exp 0x9d)\n",carlos(case_b)); > printf("carlos(case_c) == 0x%02x (exp 0x58)\n",carlos(case_c)); > } > > Bill, send the cash to my Nochex account.

Impressive, are you sure 0x58 is wrong?

;)

--
Thanks, Frank.
(remove 'x' and 'invalid' when replying by email)
Reply to
Frank Bemelman
Loading thread data ...

well what did you expect!

Reply to
CBarn24050

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.