0

i try to calculate checksum in .net in order to send data to php server. I use an webservice...

php use Crc32 function link

the php checksum is only numbers...

and i use crc32 from here

my call is :

        [...]
        Crc32 checksum = new Crc32();
        foreach (byte b in crc32.ComputeHash(buffer))
                hash += b.ToString("x2").ToLower();
        // send data and checksum in webservice

UPDATE EXAMPLE

for a file (cv.txt) with this content : Hello word !

the checksum .NET is fca641d7

and the php checksum is 1016497679

and it's not the same output... Php cannot read the data because the checksum is different

Someone know how to do ?

UPDATE 2 LINK FILE CV.TXT password : 'cv' (without quote)

Thanks !

4

1 回答 1

0

CRC 是一个数字,而不是一个字符串。您可以使用 printf 以十六进制显示它,例如“%'08x”。

于 2013-05-27T22:40:57.543 回答