I agree that since this is not a cryptographic application, the fact that md5 has some collisions is less relevent, maybe even irrelevent unless you have a very large set of URIs you need to pull from memcached uniquely.<br>
<br>Due to the way nginx configuration and modules work, I am not sure that it is viable to have $md5(SOMETHING) return md5.&nbsp; A more likely (and probably relatively easy to implement) solution might be something like this:<br>
<br>location /testing {<br>&nbsp;&nbsp;
 set_md5 $memcached_key $request_uri;<br>&nbsp;&nbsp;
 memcached_pass localhost:11211;<br>
 }<br><br>Perhaps I&#39;ll take a shot at it later on in the week :).<br><br><div class="gmail_quote">On Mon, Jan 26, 2009 at 3:25 PM, Sergio Bruder <span dir="ltr">&lt;<a href="mailto:bruder@haxent.com.br">bruder@haxent.com.br</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Em 26/01/2009, ās 20:47, Geoff Geoff escreveu:<div><div></div><div class="Wj3C7c"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dave Cheney wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
md5 is not guaranteed to be unique, that is to say, two seperate<br>
inputs can generate the same hash, so you would need to use extra<br>
logic in your application if you wanted to guard against this remote<br>
possibility. I&#39;m guessing the problem you are trying to solve is the<br>
memcache key has a limitation that is shorter than the possible<br>
request_uri ?<br>
<br>
Cheers<br>
<br>
Dave<br>
</blockquote>
<br>
Thanks Dave,<br>
<br>
The problem is that memcached will not allow certain characters in the<br>
key name - so I thought it might be simpler to just store the md5 of the<br>
actual request_uri.<br>
<br>
Thanks,<br>
Geoff<br>
</blockquote>
<br></div></div>
There are the theoretical chance of colision, yes, but you probably can use<br>
it anyway without a practical chance of colision.<br>
<br>
<br>
Sergio Devojno Bruder<br>
<a href="mailto:bruder@haxent.com.br" target="_blank">bruder@haxent.com.br</a><br>
Haxent Consultoria<br>
<a href="http://haxent.com.br/" target="_blank">http://haxent.com.br/</a><br>
41 3362-1460<br>
41 9933-8764<br>
<br>
<br>
</blockquote></div><br>