> Having said that, what's the point in storing a hash code in a
> database table?  Basically this is redundant information and when
> querying you would want to check for the key fields anyway because
> hash codes are by far not unique.  So the hash code is not helpful
> during querying.  Jim, what's the point?

Hi,

Thanks both for the answers.

I'm using it to prevent double data submission in my rails app.
When a user submits my form, I create an array of everything he/she has 
submitted. Then I create a hash-code of this array and compare it with 
the hash code of the last successful submission (which is stored in the 
db table).
This effectively eliminates double data submission (i.e. a user pressing 
submit multiple times or using the back button and resubmitting).

I looked high and low for an effective method to stop double data 
submission and couldn't find anything that worked well, thus I came up 
with this idea.

If this is a backwards method of preventing double data submission and I 
am missing something obvious, please do let me know.

Cheers,
Jim
-- 
Posted via http://www.ruby-forum.com/.