title: How efficient is the encoding/decoding algorithm of BASE64 class in Java?
body: <p>I am about to use an algorithm to encode a variable length but very long <strong>String</strong> field retrieved from an XML file, then that encoded data should be persisted in the database.</p>
  
  <p>Later, when I recieve a second file I need to fetch the encoded data from database (previously stored) and then decode it and validate with the new data for duplicate.</p>
  
  <p>I tried <code>org.apache.commons.codec.binary.Base64</code> class
  it has 2 methods:</p>
  
  <ol>
  <li><code>encodeBase64(Byte[] barray)</code></li>
  <li><code>decodeBase64(String str)</code></li>
  </ol>
  
  <p>which works perfectly fine and solves my problem.
  But it converts 55 char string to just 6 char String.</p>
  
  <p>So I wonder if there is any case where these algorithm encodes 2 Strings which are very large and have only 1 char mismatch (for example) into same encoded byte arrays.</p>
  
  <p>I donot know about the <code>Base64</code> class much but if anyone can help me out it will be really helpful.</p>
  
  <p>If you can suggest any other Algorithm which makes a large String short of fixed length and solves my purpose I will be happy to use it.</p>
  
  <p>Thanks in advance.</p>