title: Convert binary to hex IPv6
body: <p>I have a binary sequence that is supposed to be an IPv6 and I am not sure if I've converted it correctly, can you please check and tell me if it's wrong?</p>
  
  <p>Here is the binary sequence:</p>
  
  <pre><code>0000000000000000 0001100000000000 0000011000000000 0000000000000000 0000000001100000 0000000000011000 0000000000000110 0000000000000001
  </code></pre>
  
  <p>and here is what I got:</p>
  
  <pre><code>0:1800:600::60:18:6:1
  </code></pre>
  
  <p>Thanks!</p>
  
  <p>Update: here is the algorithm that I used to generate the hex values:</p>
  
  <p><em>IPv6 is consisted of 128 bits, I devide it into 8 different groups of 16 bits,
  get a group of 16 bits and devide it into 4 groups of 4 bits
  then I convert every group of 4 bits into hex, join the 4 different values I get,
  then repeat for the rest (7 groups) of 16 bits(2B).
  After that I add ':' between every group of (now) hex values.
  Find and remove the zeros from the front of the groups, then, 
  find the biggest subsequence that are consisted only of zeros,
  remove them and leave only "::" instead.</em></p>