Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
and then just appending the 9 digit session id.unpack "N", pack "C4", split /\./, "64.58.79.230"
Security is not an issue really, so a seed might not even be necessary. Also, the ability to encode is much more important than the ability to decode. So if encoding without the ability to decode is all I can get, than I'll make do. As long as no unique combination of IP address and sessionid will produce the same 9 digit number, I'm ok.$uniq_result = encode("static_seed","64.58.79.230","542158235"); ($IP,$sessionid) = decode("static_seed",$uniq_result);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: integer encoder/decoder
by dga (Hermit) on Mar 13, 2003 at 18:57 UTC | |
by Anonymous Monk on Mar 13, 2003 at 19:15 UTC | |
|
Re: integer encoder/decoder
by jasonk (Parson) on Mar 13, 2003 at 18:31 UTC | |
by Anonymous Monk on Mar 13, 2003 at 18:39 UTC | |
by merlyn (Sage) on Mar 13, 2003 at 20:52 UTC | |
|
Re: integer encoder/decoder
by bart (Canon) on Mar 13, 2003 at 22:24 UTC | |
by Anonymous Monk on Mar 13, 2003 at 23:30 UTC | |
by zengargoyle (Deacon) on Mar 14, 2003 at 00:38 UTC | |
by Anonymous Monk on Mar 14, 2003 at 00:47 UTC | |
by merlyn (Sage) on Mar 14, 2003 at 00:58 UTC | |
by zengargoyle (Deacon) on Mar 14, 2003 at 02:10 UTC |