title: Convert JavaScript to C#
body: <p>How to convert this JavaScript to C#?</p>
  
  <pre><code>&lt;script&gt;
    function zeroPad(num, places) {
      var zero = places - num.toString().length + 1;
      return Array(+(zero &gt; 0 &amp;&amp; zero)).join("0") + num;
    }
  
      var accum = 0;
      var pin = parseInt(form.mac.value.replace(/:/g, '').slice(-6), 16) % 12000;
      var p = pin;
      while (pin)
        accum = (((accum + (3 * (pin % 10))) | 0) + (((pin / 10) | 0) % 10)) | 0, pin = ((pin / 100) | 0);
      accum = ((10 - accum % 10) % 10);
      form.pin.value = (zeroPad(p, 7) + "" + accum);
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>Please explain me this line in details?</p>
  
  <pre><code>parseInt(form.mac.value.replace(/:/g, '').slice(-6), 16) % 12000;
  </code></pre>