title: Can I construct a BigInt with any byte array (Scala)?
body: <p>I'm trying to represent the result of an MD5 hash in the shortest possible string. It seems a waste to just turn it into a hex string and let G through Z go to waste.</p>
  
  <p>One idea I have had is getting the MD5 hash of my input as an array of bytes and constructing a <code>BigInt</code> with it. I can then call <code>toString(36)</code>, and get the number as a base-36 in a string (<code>-?[0-9a-z]*</code>, the number can be positive or negative). It works for me.</p>
  
  <p>Problem is, I'm not sure that a <code>BigInt</code> can be constructed with any array of bytes, and I can't prove it with testing (at least not in a timely way!). I assume so, because I understand that a BigInt can be of arbitrary size. I can't use this method until I know for sure that it will work for all possible outputs. So, can anyone tell me whether it will work for all inputs (or how to easily convert a byte array so it can be represented in base 36).</p>
  
  <p><strong>Clarification</strong>: I have the implementation, I'm asking about the behaviour over the whole domain (i.e. 00000000000000000000000000000000 to FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)</p>