Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP CRC Function
Message
From
21/12/2012 15:03:13
 
 
To
21/12/2012 14:55:10
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01560390
Message ID:
01560420
Views:
50
Its being used as a simple handshake check between 2 VFP applications. One of these applications is being rewritten in a different langauge and I was just looking at whether it would be easier to recode this function in the new language or whether to recode the SYS(2007) in the remaining VFP app to something else. Hence the collision thing is not an issue for the purpose to which it is being used.


>I can't think of any valid use for that function. It's a poor choice to generate a hash, collisions are far too frequent e.g.
>
>?SYS( 2007, "plumless", 0, 1 )  &&1306201125
>?SYS( 2007, "buckeroo", 0, 1 )  &&1306201125
>
>Much better to use something like MD5 or one of the SHA hash functions. MD5 is considered "broken" for hard cryptographic use but is good enough for most other purposes.
>
>http://preshing.com/20110504/hash-collision-probabilities
>
>>That's right Thomas :) I know how to use SYS(2007). I am thinking of trying to implement the function in another langauge if its not too much work.
>>
>>
>>>Hmm,
>>>
>>>I thought Jos was after the code used to implement the vfp version OF sys(2007) to use perhaps in a another tier...
>>>
>>>Jooooos ?
>>>
>>>
>>>
>>>>ENTER IN THE COMMAND WINDOW
>>>>HELP SYS(2007)
>>>>
>>>>I use it to compare 2 values to see if they no longer match. Such as when updating a remote MySQL database. No need to send the update over the wire if no changes where made. Note that I am leaving out the flags, etc here to simplify but you should get the idea.
>>>>
>>>>
nOrgCkVal =  SYS(2007,CustName)
>>>>...user edits data here...
>>>>before save
>>>>if nOrgCkVal <> SYS(2007,CustName)
>>>>  update the server cause the data has changed
>>>>endif
>>>>
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform