title: How does this Java code which determines whether a String contains all unique characters work?
body: <p>I have a program which I found online which basically tells whether the <code>String</code> contains all unique characters, below is the code</p>
  
  <pre><code>private static boolean areCharsUnique(String str) {
          if (str.length() &gt; 256)
              return false;
          int checker = 0;
          for (int i = 0; i &lt; str.length(); i++) {
              int val = str.charAt(i) - 'a';
              if ((checker &amp; (1 &lt;&lt; val)) &gt; 0) {
                  return false;
              }
              checker |= (1 &lt;&lt; val);
          }
          return true;
      }
  </code></pre>
  
  <p>I am baffled by this line of code <code>if ((checker &amp; (1 &lt;&lt; val)) &gt; 0)</code> and also </p>
  
  <p><code>checker |= (1 &lt;&lt; val);</code></p>
  
  <p>I know that <code>&lt;&lt;</code> is a left shift operator, but how exactly left shifting helps in the above situation?</p>
  
  <p><strong>In short how does the above program work?</strong></p>