title: Urlencode/decode, different representation of the same string
body: <p>I am a bit out of my comfort zone here, so I'm not even sure I'm aproaching the problem appropriately. Anyhow, here goes:</p>
  
  <p>So I have a problem where I shall hash some info with sha1 that will work as that info's id.<br>
  when a client wants to signal what current info is being used, it sends a percent-encoded sha1-string.  </p>
  
  <p>So one example is, my server hashes some info and gets a hex representation like so:<br>
  <code>44 c1 b1 0d 6a de ce 01 09 fd 27 bc 81 7f 0e 90 e3 b7 93 08</code></p>
  
  <p>and the client sends me </p>
  
  <p><code>D%c1%b1%0dj%de%ce%01%09%fd%27%bc%81%7f%0e%90%e3%b7%93%08</code></p>
  
  <p>Removing the % we get </p>
  
  <p><code>D c1 b1 0dj de ce 01 09 fd 27 bc 81 7f 0e 90 e3 b7 93 08</code></p>
  
  <p>which matches my hash except for the beginning D and the j after the 0d, but replacing those with their ascii hex no, we have identical hash.  </p>
  
  <p>So, as I have read and understood the urlencoding, the standard would allow a client to send the D as either D or %44? So different clients would be able to send different representations off the same hash, and I will not be able to just compare them for equality? </p>
  
  <p>I would prefer to be able to compare the urlencoded strings as they are when they are sent, but one way to do it would be to decode them, removing all '%' and get the ascii hex value for whatever mismatch I get, much like the D and the j in my above example.  </p>
  
  <p>This all seems to be a very annoying way to do things, am I missing something, please tell me I am? :)</p>
  
  <p>I am doing this in node.js but I suppose the solution would be language/platform agnostic.</p>