title: Ruby: Convert Byte Array to Integer?
body: <p>I am trying to duplicate this snippet of <code>C#</code> code in <code>Ruby</code>:</p>
  <pre><code>var guid = Guid.Parse(&quot;a823efd8-c8c1-4cf5-9aad-3b95d6f11371&quot;);
  byte[] a = guid.ToByteArray();
  var bigInteger = new BigInteger(a, isUnsigned: true);
  </code></pre>
  <p>I've gotten as far as creating the byte array with help from <a href="https://stackoverflow.com/questions/54788845/how-can-i-convert-a-guid-into-a-byte-array-in-ruby/54790603#54790603">this answer</a>:</p>
  <pre class="lang-rb prettyprint-override"><code>guid = 'a823efd8-c8c1-4cf5-9aad-3b95d6f11371'
  parts = guid.split('-')
  mixed_endian = parts.pack('H* H* H* H* H*')
  big_endian = mixed_endian.unpack('L&lt; S&lt; S&lt; A*').pack('L&gt; S&gt; S&gt; A*')
  byte_array = big_endian.bytes
  #=&gt; [216, 239, 35, 168, 193, 200, 245, 76, 154, 173, 59, 149, 214, 241, 19, 113]
  </code></pre>
  <p>I'm not sure what to do to convert this array of bytes into an integer - line 3 of the <code>C#</code> example above. Can anyone help me figure out what to do?</p>