Hi,

I try to use Python (3) to verify the checksum at the end of a BlueStore 
superblock, but I cannot figure it out how to do it.

In my test scenario, the superblock is 0x158 bytes long (starting with 
"bluestore block device\n<uuid>\n"), then 4 bytes of CRC32 follow. In my case 
the checksum is 0xb759e167.

To verify the checksum I read bytes 0x0-0x157 and compute the CRC32.
As I understand the code, the CRC is initialized with -1.
Therefore my code looks like this:
crc = binascii.crc32(f.read(0x158), -1)

And afterwards crc contains 0xbaa01c56.

I tried several Python libraries for CRC32 computation and cannot get it 
working with any of them.

I guess I miss something, like an extra step, or I have to use a certain lib. 
Maybe somebody of you got an idea.


Thanks in advance,
Florian
_______________________________________________
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

Reply via email to