title: Storing integers in a redis ordered set?
body: <p>I have a system which deals with keys that have been turned into unsigned long integers (by packing short sequences into byte strings). I want to try storing these in Redis, and I want to do it in the best way possible. My concern is mainly memory efficiency.</p>
  
  <p>From playing with the online REPL I notice that the two following are identical</p>
  
  <pre><code>zadd myset 1.0 "123"
  
  zadd myset 1.0 123
  </code></pre>
  
  <p>This means that even if I know I want to store an integer, it has to be set as a string. I notice from the documentation that keys are just stored as <code>char*</code>s and that commands like <a href="http://redis.io/commands/setbit" rel="noreferrer">SETBIT</a> indicate that Redis is not averse to treating strings as bytestrings in the client. This hints at a slightly more efficient way of storing <code>unsigned long</code>s than as their string representation.</p>
  
  <p>What is the best way to store <code>unsigned long</code>s in sorted sets?</p>