[kwlug-disc] Hash functions.

Joe Wennechuk youcanreachmehere at hotmail.com
Sun Jan 2 13:36:22 EST 2011

That is what I was thinking.. The coupon would be like...

FROM: spoofed [The Fairview Mall mcdonalds  sms phone number]
its hot out! get .99 shake. at McDonalds when you transfer at Fairview!!


I would generate the redeem with the time the coupon was issued, the store id number from my database and the text of the coupon itself. 

when they reply the reply go's to the store itself to let them know the coupon had been redeemed.

the UDI is the @#1AB%$ which is the thing I'm trying to generate.. It needs to be as small as possible and still unique. I may still have to just use a serial number, and then hash that . Maybe I'm overthinking this..

Joseph Wennechuk


> Date: Sun, 2 Jan 2011 12:39:59 -0500
> From: john at netdirect.ca
> To: kwlug-disc at kwlug.org
> Subject: Re: [kwlug-disc] Hash functions.
> ----- Original Message -----
> > ----- Original Message -----
> > > Yes.. thank you CRC is exactly what I'm looking for.
> > 
> > Keep in mind that a CRC will not guarantee uniqueness, there may be
> > two messages that generate the same CRC. In cases like yours I'd look
> > for things that naturally make it unique. If you have the phone number
> > of the SMS source and the date/time in seconds or microseconds, that
> > alone could make a unique number. Reduce the size by doing some coding
> > with the numbers, "pack digits" or convert the phone number to an
> > integer and the date/time to another. A final check to see if there
> > was a duplicate message in the last second and few bits for a count
> > and you should have uniqueness.
> > 
> > For something a little different than that try a GUID or UUID. You
> > should be able to find a function to generate one. The number is so
> > large that randomly generating GUID should not result in a duplicate
> > GUID for a long time.
> > 
> > Also mentioned was predictabilty. If there is a chance predicable IDs
> > could result in a security issue you should go with GUIDs.
> http://php.net/manual/en/function.uniqid.php
> http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/
> -- 
> John Van Ostrand 
> CTO, co-CEO 
> Net Direct Inc. 
> 564 Weber St. N. Unit 12, Waterloo, ON N2L 5C6 
> Ph: 866-883-1172 x5102 
> Fx: 519-883-8533 
> Linux Solutions / IBM Hardware 
> _______________________________________________
> kwlug-disc_kwlug.org mailing list
> kwlug-disc_kwlug.org at kwlug.org
> http://astoria.ccjclearline.com/mailman/listinfo/kwlug-disc_kwlug.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20110102/812ff497/attachment.html>

More information about the kwlug-disc mailing list