Antonio,
Nop, let me resume:
With a simple string: "Hola" + Chr(0), i get:
nStrCrc() -> Harbour + FiveWin: 254842013
nStrCrc16 -> Harbour + FiveWin: 23978
HB_CRC32 -> Harbour + FiveWin: 4040125282
nStrCrc() -> Clipper + FiveWin: 812493129
See? A simple string show difference in CRC function.
The problem? I have sensible data stored (in every customer) with their respective Checksum calculated with nStrCrc() using Clipper + FW. If the Checksum fail, the data is bad. Now, with Harbour + FWh the most data has error because the old CRC of that data differs of the new CRC of the same data, showing error but really is not.
I test the code you suggested and it is the same like nStrCrc16() -> Harbour + FiveWin.
I test other CRC codes but nothing return the same like your function nStrCrc() in Clipper + FiveWin.
I hope you understand me
, any way i wrote a simple code to test:
- Code: Select all Expand view
#include "Fivewin.ch"
#define C_TEXT "Hola" + Chr( 0 )
FUNCTION MAIN()
#ifdef __HARBOUR__
? "nStrCrc Harbour + FiveWin: " + cValToChar( nStrCrc( C_TEXT ) ), ;
"nStrCrc16 Harbour + FiveWin: " + cValToChar( nStrCrc16( C_TEXT ) ) + CRLF, ;
"HB_CRC32 Harbour + FiveWin: " + cValToChar( HB_CRC32( C_TEXT ) ) + CRLF
#endif
#ifdef __CLIPPER__
? "nStrCrc Clipper + FiveWin: " + cValToChar( nStrCrc( C_TEXT ) )
#endif
RETURN NIL
Thanks