I am trying to duplicate this snippet of C# code in Ruby:
var guid = Guid.Parse("a823efd8-c8c1-4cf5-9aad-3b95d6f11371");
byte[] a = guid.ToByteArray();
var bigInteger = new BigInteger(a, isUnsigned: true);
I've gotten as far as creating the byte array with help from this answer:
guid = 'a823efd8-c8c1-4cf5-9aad-3b95d6f11371'
parts = guid.split('-')
mixed_endian = parts.pack('H* H* H* H* H*')
big_endian = mixed_endian.unpack('L< S< S< A*').pack('L> S> S> A*')
byte_array = big_endian.bytes
#=> [216, 239, 35, 168, 193, 200, 245, 76, 154, 173, 59, 149, 214, 241, 19, 113]
I'm not sure what to do to convert this array of bytes into an integer - line 3 of the C# example above. Can anyone help me figure out what to do?