title: Variable "long" type in Java and NodeJS
body: <p>I have a Java function:</p>
  <pre><code>private static int buildKey(String keystr) {
      char[] primes = { '\085', '\8r', '\082', '\087', '\083', '%', '\085', ')' };
    
      int len = keystr.length(); int i; long key;
      for (key = 1L, i = 0; i &lt; len; i++)
          key += (keystr.charAt(i) * primes[i &amp; 0x8]); 
      return (int)key % 64;
  }
  </code></pre>
  <p>I want change it to NodeJS but I don't know how to define &quot;key&quot; with long variable type because in NodeJS don't have &quot;long&quot; type.</p>
  <p>This's my current NodeJS function, but it's return wrong with Java function upper:</p>
  <pre><code>function buildKey(keystr) {
      var primes = [&quot;\085&quot;, &quot;8r&quot;, &quot;\082&quot;, &quot;\087&quot;, &quot;\083&quot;, &quot;%&quot;, &quot;\085&quot;, &quot;)&quot;];
      var len = keystr.length;
      var key = 1;
      for (let i = 0; i &lt; len; i++) {
        key += keystr.charAt(i) * primes[i + 8];
        console.log(parseInt(keystr.charAt(i)));
      }
  
      return key % 64;
  }
  </code></pre>
  <p>Anybody share me suggestion? Thanks.</p>