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 )
>?SYS( 2007, "buckeroo", 0, 1 )
>
>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.