title: digits in long to base64 characters
body: <p>I am working on a small task which requires some base64 encoding. I am trying to do it in head but getting lost . </p>
  
  <p>I have a 13 digit number in java long format say: 1294705313608 , 1294705313594 , 1294705313573</p>
  
  <p>I do some processing with it, bascially I take this number append it with stuff put it in a byte array and then convert it to base64 using:</p>
  
  <pre><code>String b64String = new sun.misc.BASE64Encoder().encodeBuffer(bArray);
  </code></pre>
  
  <p>Now , I know that for my original number, the first 3 digits would never change. So 129 is constant in above numbers. I want to find out how many chars corresponding to those digits would not change in the resultant base64 string. </p>
  
  <p>Code to serialize long to the byte array. I ignore the first 2 bytes since they are always 0:</p>
  
  <p>bArray[0] = (byte) (time >>> 40);<br>
      bArray[1] = (byte) (time >>> 32);<br>
      bArray[2] = (byte) (time >>> 24);<br>
      bArray[3] = (byte) (time >>> 16);<br>
      bArray[4] = (byte) (time >>> 8);<br>
      bArray[5] = (byte) (time >>> 0);</p>
  
  <p>Thanks.</p>
  
  <p>Notes:
  I know that base64 would take 6 bits and make one character out of it. So if first 3 digits do not change in long how many chars would not change in base64.
  This in NOT a HW assignment, but I am not very familiar with encoding.</p>