UInt128Utils.cs
1 using System; 2 using System.Globalization; 3 4 namespace Ryujinx.Common.Utilities 5 { 6 public static class UInt128Utils 7 { 8 public static UInt128 FromHex(string hex) 9 { 10 return new UInt128(ulong.Parse(hex.AsSpan(0, 16), NumberStyles.HexNumber), ulong.Parse(hex.AsSpan(16), NumberStyles.HexNumber)); 11 } 12 13 public static UInt128 CreateRandom() 14 { 15 return new UInt128((ulong)Random.Shared.NextInt64(), (ulong)Random.Shared.NextInt64()); 16 } 17 } 18 }