Re: crc algorithm

2014-09-03 Thread dream4soul
On Wednesday, September 3, 2014 12:00:10 PM UTC+3, Peter Otten wrote: > dream4s...@gmail.com wrote: > > > > > calc_crc(b'\x00\x00\x34\x35\x38\x35') > > > > > unsigned char a[]={0x30,0x30,0x34,0x35,0x38,0x35}; > > > > The first two bytes differ; you made an error on the input. Dear Peter,

Re: crc algorithm

2014-09-03 Thread dream4soul
On Wednesday, September 3, 2014 12:00:10 PM UTC+3, Peter Otten wrote: > dream4s...@gmail.com wrote: > > > > > calc_crc(b'\x00\x00\x34\x35\x38\x35') > > > > > unsigned char a[]={0x30,0x30,0x34,0x35,0x38,0x35}; > > > > The first two bytes differ; you made an error on the input. Dear Peter,

Re: crc algorithm

2014-09-03 Thread Peter Otten
dream4s...@gmail.com wrote: > calc_crc(b'\x00\x00\x34\x35\x38\x35') > unsigned char a[]={0x30,0x30,0x34,0x35,0x38,0x35}; The first two bytes differ; you made an error on the input. -- https://mail.python.org/mailman/listinfo/python-list

Re: crc algorithm

2014-09-03 Thread dream4soul
On Wednesday, September 3, 2014 10:19:29 AM UTC+3, Peter Otten wrote: > dream4s...@gmail.com wrote: > > > > > On Tuesday, September 2, 2014 9:24:54 PM UTC+3, Peter Otten wrote: > > >> dream4s...@gmail.com wrote: > > >> > > >> > >

Re: crc algorithm

2014-09-03 Thread dream4soul
On Wednesday, September 3, 2014 10:19:29 AM UTC+3, Peter Otten wrote: > dream4s...@gmail.com wrote: > > > > > On Tuesday, September 2, 2014 9:24:54 PM UTC+3, Peter Otten wrote: > > >> dream4s...@gmail.com wrote: > > >> > > >> > >

Re: crc algorithm

2014-09-03 Thread Mark Lawrence
On 03/09/2014 07:19, dream4s...@gmail.com wrote: Would you please access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing and single line paragraphs, thanks. --

Re: crc algorithm

2014-09-03 Thread Peter Otten
dream4s...@gmail.com wrote: > On Tuesday, September 2, 2014 9:24:54 PM UTC+3, Peter Otten wrote: >> dream4s...@gmail.com wrote: >> >> >> >> > I have trouble to implement crc algorithm in python 3.3 >> >> > >> >> > c version w

Re: crc algorithm

2014-09-02 Thread dream4soul
return binascii.crc32(data) > > > Much simpler. > > > > > Chris > > > > > > On Tue, Sep 2, 2014 at 11:24 AM, Peter Otten <__pe...@web.de> wrote: > > > > dream...@gmail.com wrote: > > > > > I have trouble to im

Re: crc algorithm

2014-09-02 Thread dream4soul
On Tuesday, September 2, 2014 9:24:54 PM UTC+3, Peter Otten wrote: > dream4s...@gmail.com wrote: > > > > > I have trouble to implement crc algorithm in python 3.3 > > > > > > c version work perfect. I try to use bytes, int and c_types without any

Re: crc algorithm

2014-09-02 Thread Chris Kaynor
wrote: > dream4s...@gmail.com wrote: > > > I have trouble to implement crc algorithm in python 3.3 > > > > c version work perfect. I try to use bytes, int and c_types without any > > success can some who help me: > > ctypes is for interfacing with C; don

Re: crc algorithm

2014-09-02 Thread Peter Otten
dream4s...@gmail.com wrote: > I have trouble to implement crc algorithm in python 3.3 > > c version work perfect. I try to use bytes, int and c_types without any > success can some who help me: ctypes is for interfacing with C; don't use it in regular code. > c version:

crc algorithm

2014-09-02 Thread dream4soul
Dear all, I have trouble to implement crc algorithm in python 3.3 c version work perfect. I try to use bytes, int and c_types without any success can some who help me: c version: unsigned short calc_crc(const void *p_dat, int l_dat){ unsigned char *dat_ptr; int loopc