<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
That is what I was thinking.. The coupon would be like...<br><br><u><b>FROM:</b></u> spoofed [The Fairview Mall mcdonalds  sms phone number]<br>streetposts.com<br>-<br>its hot out! get .99 shake. at McDonalds when you transfer at Fairview!!<br><br>Redeem:<br>@#1AB%$.<br><br>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. <br><br>when they reply the reply go's to the store itself to let them know the coupon had been redeemed.<br><br>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..<br><br><br><br><br>Joseph Wennechuk<br>
________________<br><br><br><br><br>> Date: Sun, 2 Jan 2011 12:39:59 -0500<br>> From: john@netdirect.ca<br>> To: kwlug-disc@kwlug.org<br>> Subject: Re: [kwlug-disc] Hash functions.<br>> <br>> <br>> <br>> ----- Original Message -----<br>> > ----- Original Message -----<br>> > > Yes.. thank you CRC is exactly what I'm looking for.<br>> > <br>> > Keep in mind that a CRC will not guarantee uniqueness, there may be<br>> > two messages that generate the same CRC. In cases like yours I'd look<br>> > for things that naturally make it unique. If you have the phone number<br>> > of the SMS source and the date/time in seconds or microseconds, that<br>> > alone could make a unique number. Reduce the size by doing some coding<br>> > with the numbers, "pack digits" or convert the phone number to an<br>> > integer and the date/time to another. A final check to see if there<br>> > was a duplicate message in the last second and few bits for a count<br>> > and you should have uniqueness.<br>> > <br>> > For something a little different than that try a GUID or UUID. You<br>> > should be able to find a function to generate one. The number is so<br>> > large that randomly generating GUID should not result in a duplicate<br>> > GUID for a long time.<br>> > <br>> > Also mentioned was predictabilty. If there is a chance predicable IDs<br>> > could result in a security issue you should go with GUIDs.<br>> <br>> http://php.net/manual/en/function.uniqid.php<br>> <br>> http://www.shapeshifter.se/2008/09/29/uuid-generator-for-php/<br>> <br>> -- <br>> John Van Ostrand <br>> CTO, co-CEO <br>> Net Direct Inc. <br>> 564 Weber St. N. Unit 12, Waterloo, ON N2L 5C6 <br>> Ph: 866-883-1172 x5102 <br>> Fx: 519-883-8533 <br>> <br>> Linux Solutions / IBM Hardware <br>> <br>> <br>> _______________________________________________<br>> kwlug-disc_kwlug.org mailing list<br>> kwlug-disc_kwlug.org@kwlug.org<br>> http://astoria.ccjclearline.com/mailman/listinfo/kwlug-disc_kwlug.org<br>                                        </body>
</html>