title: Concept behind converting Base16 to Base64
body: <p>I understand how to read decimal, binary, hex and base64; that is I can manually convert numbers/counts expressed as each of those bases to expressions in the other bases.</p>
  
  <p>I'm doing the matasano crypto challenges and the very first assignment got me thinking (<a href="https://cryptopals.com/sets/1/challenges/1" rel="nofollow noreferrer">https://cryptopals.com/sets/1/challenges/1</a>).</p>
  
  <p>The approaches to this problem that I found convert the hexstring to bytes (binary) and then the bytes to base64. Which I understand. Or so I thought. Could I simply concatenate these bytes and say I have the binarystring expression of the same number?</p>
  
  <p>I noticed they basically read the hexstring 2 hexcharacters at a time (because 2 hexcharacters is one byte at most). This results in a binarystring where each binarycharacter(bit) is "aligned" with the hexcharacter(s) it came from. </p>
  
  <p>Does this mean I can just convert this binarystring to decimal and it will be same "number" that the hexstring represents?</p>
  
  <p>Could a similar character-by-character scheme be done to convert to base64? How many hexcharacters per base64character?</p>