Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a checksum for a record
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00344258
Message ID:
00344291
Views:
18
>Greetings all,
>
>A Question: I'm needing to create a checksum value for a record in a table based on the data in each field. Does anyone have an algorithm to share or know of a third-party utility to do same?
>
>TIA

I have a ChkSum integer field in my tables to store the validated value. This is usually to detect hacking. If the ChkSum value is incorrect when I check, whatever feature that record or table is linked to is then disabled in the app until I, or the application manager, is notified and fixes it. The routine I use is something like:
local lnChkSum, i, lcFName
lnChkSum = 0
for i = 1 to fcount()
	lcFName = field(i)
	if lcFName = "CHKSUM"
		loop
	endif
	lcData = transform(eval(lcFName), "@T")
	lcVal = Sys[2007, lcData ]
	lnChkSum = lnChkSum + val(lcVal)
endfor
return lnChkSum
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform