Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create an int32 checksum?

Status
Not open for further replies.

MrPeds

Programmer
Jan 7, 2003
219
GB
Hi,

I have an Int column in a sql 2000 database which states if the row is locked or not. if the row is not locked the column equals zero (0).

Otherwise, if the row is considered locked I have been asked to set a checksum value for the column.

I was thinking of using all the other columns in the row appended together to create a string as the key. (One of the columns in the row is an auto-incrementing id.)

from this point I am not sure what kind of encryption algorithm to use to give me an int32 value based on the key to assign to the locked column.

any examples or ideas are appreciated.

MrPeds
 
XOR works well enough, and ought to be faster than the stronger algorithms.

Be aware that 0 is a valid value for any checksum algorithm -- you'll want a separate column to store the checksum, and turn the IsLocked column into a bit type.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
any ideas on how to go about doing this?

I am a newbie to this kind of thing.

Regards,

MrPeds
 
..actually, i used the BINARY_CHECKSUM function available in sql 2k.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top