mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-21 01:29:57 -04:00
Import the base tree (MIT, see LICENSE)
This commit is contained in:
20
tools/vendor/ryujinx/src/Ryujinx.Common/Utilities/UInt128Utils.cs
vendored
Normal file
20
tools/vendor/ryujinx/src/Ryujinx.Common/Utilities/UInt128Utils.cs
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Ryujinx.Common.Utilities
|
||||
{
|
||||
public static class UInt128Utils
|
||||
{
|
||||
public static UInt128 FromHex(string hex) =>
|
||||
new(
|
||||
ulong.Parse(hex.AsSpan(0, 16), NumberStyles.HexNumber),
|
||||
ulong.Parse(hex.AsSpan(16), NumberStyles.HexNumber)
|
||||
);
|
||||
|
||||
public static Int128 NextInt128(this Random rand) =>
|
||||
new((ulong)rand.NextInt64(), (ulong)rand.NextInt64());
|
||||
|
||||
public static UInt128 NextUInt128(this Random rand) =>
|
||||
new((ulong)rand.NextInt64(), (ulong)rand.NextInt64());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user