mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-29 05:40:32 +00:00
18 lines
No EOL
507 B
C#
18 lines
No EOL
507 B
C#
using System;
|
|
using System.Globalization;
|
|
|
|
namespace Ryujinx.Common.Utilities
|
|
{
|
|
public static class UInt128Utils
|
|
{
|
|
public static UInt128 FromHex(string hex)
|
|
{
|
|
return new UInt128(ulong.Parse(hex.AsSpan(0, 16), NumberStyles.HexNumber), ulong.Parse(hex.AsSpan(16), NumberStyles.HexNumber));
|
|
}
|
|
|
|
public static UInt128 CreateRandom()
|
|
{
|
|
return new UInt128((ulong)Random.Shared.NextInt64(), (ulong)Random.Shared.NextInt64());
|
|
}
|
|
}
|
|
} |