Skip to content

Instantly share code, notes, and snippets.

@smdn
Created March 5, 2022 12:35
Show Gist options
  • Save smdn/180486aa4569aca995fae4fe62ad4bd9 to your computer and use it in GitHub Desktop.
Save smdn/180486aa4569aca995fae4fe62ad4bd9 to your computer and use it in GitHub Desktop.
Smdn.Fundamental.Uuid 3.0.3 Release Notes
diff --git a/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-net45.apilist.cs b/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-net45.apilist.cs
index 8468307a..3c887023 100644
--- a/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-net45.apilist.cs
+++ b/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-net45.apilist.cs
@@ -1,161 +1,161 @@
-// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.0.2)
+// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.0.3)
// Name: Smdn.Fundamental.Uuid
-// AssemblyVersion: 3.0.2.0
-// InformationalVersion: 3.0.2+3b6d4bbdb8e89104beed8bc83b9b240f09d0749d
+// AssemblyVersion: 3.0.3.0
+// InformationalVersion: 3.0.3+f2674783671f52cc107bf9220db31542d68751ae
// TargetFramework: .NETFramework,Version=v4.5
// Configuration: Release
using System;
using System.Net.NetworkInformation;
using System.Security.Cryptography;
using Smdn;
using Smdn.Formats.UniversallyUniqueIdentifiers;
namespace Smdn {
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
public enum UuidVersion : byte {
NameBasedMD5Hash = 3,
NameBasedSHA1Hash = 5,
None = 0,
RandomNumber = 4,
TimeBased = 1,
Version1 = 1,
Version2 = 2,
Version3 = 3,
Version4 = 4,
Version5 = 5,
}
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public readonly struct Uuid :
IComparable,
IComparable<Guid>,
IComparable<Uuid>,
IEquatable<Guid>,
IEquatable<Uuid>,
IFormattable
{
public enum Namespace : int {
RFC4122Dns = 1806153744,
RFC4122IsoOid = 1806153746,
RFC4122Url = 1806153745,
RFC4122X500 = 1806153748,
}
public enum Variant : byte {
MicrosoftReserved = 192,
NCSReserved = 0,
RFC4122 = 128,
Reserved = 224,
}
public static readonly Uuid Nil; // = "00000000-0000-0000-0000-000000000000"
public static readonly Uuid RFC4122NamespaceDns; // = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceIsoOid; // = "6ba7b812-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceUrl; // = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceX500; // = "6ba7b814-9dad-11d1-80b4-00c04fd430c8"
public Uuid(Guid guidValue) {}
public Uuid(ReadOnlySpan<byte> octets) {}
public Uuid(ReadOnlySpan<byte> octets, bool isBigEndian) {}
public Uuid(byte[] octets) {}
public Uuid(byte[] octets, bool isBigEndian) {}
public Uuid(byte[] octets, int index, bool isBigEndian = true) {}
public Uuid(string uuid) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, PhysicalAddress node) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte node0, byte node1, byte node2, byte node3, byte node4, byte node5) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte[] node) {}
public int Clock { get; }
public byte ClockSeqHighAndReserved { get; }
public byte ClockSeqLow { get; }
public string IEEE802MacAddress { get; }
public byte[] Node { get; }
public PhysicalAddress PhysicalAddress { get; }
public ushort TimeHighAndVersion { get; }
public uint TimeLow { get; }
public ushort TimeMid { get; }
public DateTime Timestamp { get; }
public Uuid.Variant VariantField { get; }
public UuidVersion Version { get; }
public int CompareTo(Guid other) {}
public int CompareTo(Uuid other) {}
public int CompareTo(object obj) {}
public static Uuid CreateFromRandomNumber() {}
public static Uuid CreateFromRandomNumber(RandomNumberGenerator rng) {}
public static Uuid CreateFromRandomNumber(ReadOnlySpan<byte> randomNumber) {}
public static Uuid CreateFromRandomNumber(byte[] randomNumber) {}
public static Uuid CreateNameBased(Uri url, UuidVersion version) {}
public static Uuid CreateNameBased(byte[] name, Uuid namespaceId, UuidVersion version) {}
public static Uuid CreateNameBased(byte[] name, Uuid.Namespace ns, UuidVersion version) {}
public static Uuid CreateNameBased(string name, Uuid namespaceId, UuidVersion version) {}
public static Uuid CreateNameBased(string name, Uuid.Namespace ns, UuidVersion version) {}
public static Uuid CreateNameBasedMD5(Uri url) {}
public static Uuid CreateNameBasedMD5(byte[] name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedMD5(string name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedSHA1(Uri url) {}
public static Uuid CreateNameBasedSHA1(byte[] name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedSHA1(string name, Uuid.Namespace ns) {}
public static Uuid CreateTimeBased() {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock) {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock, PhysicalAddress node) {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock, byte[] node) {}
public static Uuid CreateTimeBased(PhysicalAddress node) {}
public static Uuid CreateTimeBased(byte[] node) {}
public bool Equals(Guid other) {}
public bool Equals(Uuid other) {}
public override bool Equals(object obj) {}
public void GetBytes(byte[] buffer, int startIndex) {}
public void GetBytes(byte[] buffer, int startIndex, bool asBigEndian) {}
public override int GetHashCode() {}
public static Uuid NewUuid() {}
public byte[] ToByteArray() {}
public byte[] ToByteArray(bool asBigEndian) {}
public Guid ToGuid() {}
public override string ToString() {}
public string ToString(string format) {}
public string ToString(string format, IFormatProvider formatProvider) {}
public static bool operator == (Uuid x, Uuid y) {}
public static explicit operator Guid(Uuid @value) {}
public static explicit operator Uuid(Guid @value) {}
public static bool operator > (Uuid x, Uuid y) {}
public static bool operator >= (Uuid x, Uuid y) {}
public static bool operator != (Uuid x, Uuid y) {}
public static bool operator < (Uuid x, Uuid y) {}
public static bool operator <= (Uuid x, Uuid y) {}
}
}
namespace Smdn.Formats.UniversallyUniqueIdentifiers {
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
public abstract class UuidGenerator {
protected UuidGenerator() {}
public static UuidGenerator CreateTimeBased() {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, Func<ushort> clockSequenceSource) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, Node node) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, PhysicalAddress node) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource, Node node) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence, Node node) {}
public abstract Uuid GenerateNext();
}
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public readonly struct Node : IFormattable {
public Node(PhysicalAddress physicalAddress) {}
public static Node CreateRandom() {}
public PhysicalAddress ToPhysicalAddress() {}
public override string ToString() {}
public string ToString(string format, IFormatProvider formatProvider = null) {}
}
}
diff --git a/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-net5.0.apilist.cs b/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-net5.0.apilist.cs
index 5bd85800..2ed7ce6f 100644
--- a/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-net5.0.apilist.cs
+++ b/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-net5.0.apilist.cs
@@ -1,161 +1,161 @@
-// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.0.2)
+// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.0.3)
// Name: Smdn.Fundamental.Uuid
-// AssemblyVersion: 3.0.2.0
-// InformationalVersion: 3.0.2+3b6d4bbdb8e89104beed8bc83b9b240f09d0749d
+// AssemblyVersion: 3.0.3.0
+// InformationalVersion: 3.0.3+f2674783671f52cc107bf9220db31542d68751ae
// TargetFramework: .NETCoreApp,Version=v5.0
// Configuration: Release
using System;
using System.Net.NetworkInformation;
using System.Security.Cryptography;
using Smdn;
using Smdn.Formats.UniversallyUniqueIdentifiers;
namespace Smdn {
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
public enum UuidVersion : byte {
NameBasedMD5Hash = 3,
NameBasedSHA1Hash = 5,
None = 0,
RandomNumber = 4,
TimeBased = 1,
Version1 = 1,
Version2 = 2,
Version3 = 3,
Version4 = 4,
Version5 = 5,
}
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public readonly struct Uuid :
IComparable,
IComparable<Guid>,
IComparable<Uuid>,
IEquatable<Guid>,
IEquatable<Uuid>,
IFormattable
{
public enum Namespace : int {
RFC4122Dns = 1806153744,
RFC4122IsoOid = 1806153746,
RFC4122Url = 1806153745,
RFC4122X500 = 1806153748,
}
public enum Variant : byte {
MicrosoftReserved = 192,
NCSReserved = 0,
RFC4122 = 128,
Reserved = 224,
}
public static readonly Uuid Nil; // = "00000000-0000-0000-0000-000000000000"
public static readonly Uuid RFC4122NamespaceDns; // = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceIsoOid; // = "6ba7b812-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceUrl; // = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceX500; // = "6ba7b814-9dad-11d1-80b4-00c04fd430c8"
public Uuid(Guid guidValue) {}
public Uuid(ReadOnlySpan<byte> octets) {}
public Uuid(ReadOnlySpan<byte> octets, bool isBigEndian) {}
public Uuid(byte[] octets) {}
public Uuid(byte[] octets, bool isBigEndian) {}
public Uuid(byte[] octets, int index, bool isBigEndian = true) {}
public Uuid(string uuid) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, PhysicalAddress node) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte node0, byte node1, byte node2, byte node3, byte node4, byte node5) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte[] node) {}
public int Clock { get; }
public byte ClockSeqHighAndReserved { get; }
public byte ClockSeqLow { get; }
public string IEEE802MacAddress { get; }
public byte[] Node { get; }
public PhysicalAddress PhysicalAddress { get; }
public ushort TimeHighAndVersion { get; }
public uint TimeLow { get; }
public ushort TimeMid { get; }
public DateTime Timestamp { get; }
public Uuid.Variant VariantField { get; }
public UuidVersion Version { get; }
public int CompareTo(Guid other) {}
public int CompareTo(Uuid other) {}
public int CompareTo(object obj) {}
public static Uuid CreateFromRandomNumber() {}
public static Uuid CreateFromRandomNumber(RandomNumberGenerator rng) {}
public static Uuid CreateFromRandomNumber(ReadOnlySpan<byte> randomNumber) {}
public static Uuid CreateFromRandomNumber(byte[] randomNumber) {}
public static Uuid CreateNameBased(Uri url, UuidVersion version) {}
public static Uuid CreateNameBased(byte[] name, Uuid namespaceId, UuidVersion version) {}
public static Uuid CreateNameBased(byte[] name, Uuid.Namespace ns, UuidVersion version) {}
public static Uuid CreateNameBased(string name, Uuid namespaceId, UuidVersion version) {}
public static Uuid CreateNameBased(string name, Uuid.Namespace ns, UuidVersion version) {}
public static Uuid CreateNameBasedMD5(Uri url) {}
public static Uuid CreateNameBasedMD5(byte[] name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedMD5(string name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedSHA1(Uri url) {}
public static Uuid CreateNameBasedSHA1(byte[] name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedSHA1(string name, Uuid.Namespace ns) {}
public static Uuid CreateTimeBased() {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock) {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock, PhysicalAddress node) {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock, byte[] node) {}
public static Uuid CreateTimeBased(PhysicalAddress node) {}
public static Uuid CreateTimeBased(byte[] node) {}
public bool Equals(Guid other) {}
public bool Equals(Uuid other) {}
public override bool Equals(object obj) {}
public void GetBytes(byte[] buffer, int startIndex) {}
public void GetBytes(byte[] buffer, int startIndex, bool asBigEndian) {}
public override int GetHashCode() {}
public static Uuid NewUuid() {}
public byte[] ToByteArray() {}
public byte[] ToByteArray(bool asBigEndian) {}
public Guid ToGuid() {}
public override string ToString() {}
public string ToString(string format) {}
public string ToString(string format, IFormatProvider formatProvider) {}
public static bool operator == (Uuid x, Uuid y) {}
public static explicit operator Guid(Uuid @value) {}
public static explicit operator Uuid(Guid @value) {}
public static bool operator > (Uuid x, Uuid y) {}
public static bool operator >= (Uuid x, Uuid y) {}
public static bool operator != (Uuid x, Uuid y) {}
public static bool operator < (Uuid x, Uuid y) {}
public static bool operator <= (Uuid x, Uuid y) {}
}
}
namespace Smdn.Formats.UniversallyUniqueIdentifiers {
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
public abstract class UuidGenerator {
protected UuidGenerator() {}
public static UuidGenerator CreateTimeBased() {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, Func<ushort> clockSequenceSource) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, Node node) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, PhysicalAddress node) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource, Node node) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence, Node node) {}
public abstract Uuid GenerateNext();
}
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public readonly struct Node : IFormattable {
public Node(PhysicalAddress physicalAddress) {}
public static Node CreateRandom() {}
public PhysicalAddress ToPhysicalAddress() {}
public override string ToString() {}
public string ToString(string format, IFormatProvider formatProvider = null) {}
}
}
diff --git a/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard1.6.apilist.cs b/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard1.6.apilist.cs
index 29a6d91a..37ba4809 100644
--- a/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard1.6.apilist.cs
+++ b/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard1.6.apilist.cs
@@ -1,149 +1,149 @@
-// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.0.2)
+// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.0.3)
// Name: Smdn.Fundamental.Uuid
-// AssemblyVersion: 3.0.2.0
-// InformationalVersion: 3.0.2+3b6d4bbdb8e89104beed8bc83b9b240f09d0749d
+// AssemblyVersion: 3.0.3.0
+// InformationalVersion: 3.0.3+f2674783671f52cc107bf9220db31542d68751ae
// TargetFramework: .NETStandard,Version=v1.6
// Configuration: Release
using System;
using System.Security.Cryptography;
using Smdn;
using Smdn.Formats.UniversallyUniqueIdentifiers;
namespace Smdn {
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
public enum UuidVersion : byte {
NameBasedMD5Hash = 3,
NameBasedSHA1Hash = 5,
None = 0,
RandomNumber = 4,
TimeBased = 1,
Version1 = 1,
Version2 = 2,
Version3 = 3,
Version4 = 4,
Version5 = 5,
}
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public readonly struct Uuid :
IComparable,
IComparable<Guid>,
IComparable<Uuid>,
IEquatable<Guid>,
IEquatable<Uuid>,
IFormattable
{
public enum Namespace : int {
RFC4122Dns = 1806153744,
RFC4122IsoOid = 1806153746,
RFC4122Url = 1806153745,
RFC4122X500 = 1806153748,
}
public enum Variant : byte {
MicrosoftReserved = 192,
NCSReserved = 0,
RFC4122 = 128,
Reserved = 224,
}
public static readonly Uuid Nil; // = "00000000-0000-0000-0000-000000000000"
public static readonly Uuid RFC4122NamespaceDns; // = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceIsoOid; // = "6ba7b812-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceUrl; // = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceX500; // = "6ba7b814-9dad-11d1-80b4-00c04fd430c8"
public Uuid(Guid guidValue) {}
public Uuid(ReadOnlySpan<byte> octets) {}
public Uuid(ReadOnlySpan<byte> octets, bool isBigEndian) {}
public Uuid(byte[] octets) {}
public Uuid(byte[] octets, bool isBigEndian) {}
public Uuid(byte[] octets, int index, bool isBigEndian = true) {}
public Uuid(string uuid) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte node0, byte node1, byte node2, byte node3, byte node4, byte node5) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte[] node) {}
public int Clock { get; }
public byte ClockSeqHighAndReserved { get; }
public byte ClockSeqLow { get; }
public string IEEE802MacAddress { get; }
public byte[] Node { get; }
public ushort TimeHighAndVersion { get; }
public uint TimeLow { get; }
public ushort TimeMid { get; }
public DateTime Timestamp { get; }
public Uuid.Variant VariantField { get; }
public UuidVersion Version { get; }
public int CompareTo(Guid other) {}
public int CompareTo(Uuid other) {}
public int CompareTo(object obj) {}
public static Uuid CreateFromRandomNumber() {}
public static Uuid CreateFromRandomNumber(RandomNumberGenerator rng) {}
public static Uuid CreateFromRandomNumber(ReadOnlySpan<byte> randomNumber) {}
public static Uuid CreateFromRandomNumber(byte[] randomNumber) {}
public static Uuid CreateNameBased(Uri url, UuidVersion version) {}
public static Uuid CreateNameBased(byte[] name, Uuid namespaceId, UuidVersion version) {}
public static Uuid CreateNameBased(byte[] name, Uuid.Namespace ns, UuidVersion version) {}
public static Uuid CreateNameBased(string name, Uuid namespaceId, UuidVersion version) {}
public static Uuid CreateNameBased(string name, Uuid.Namespace ns, UuidVersion version) {}
public static Uuid CreateNameBasedMD5(Uri url) {}
public static Uuid CreateNameBasedMD5(byte[] name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedMD5(string name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedSHA1(Uri url) {}
public static Uuid CreateNameBasedSHA1(byte[] name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedSHA1(string name, Uuid.Namespace ns) {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock, byte[] node) {}
public static Uuid CreateTimeBased(byte[] node) {}
public bool Equals(Guid other) {}
public bool Equals(Uuid other) {}
public override bool Equals(object obj) {}
public void GetBytes(byte[] buffer, int startIndex) {}
public void GetBytes(byte[] buffer, int startIndex, bool asBigEndian) {}
public override int GetHashCode() {}
public byte[] ToByteArray() {}
public byte[] ToByteArray(bool asBigEndian) {}
public Guid ToGuid() {}
public override string ToString() {}
public string ToString(string format) {}
public string ToString(string format, IFormatProvider formatProvider) {}
public static bool operator == (Uuid x, Uuid y) {}
public static explicit operator Guid(Uuid @value) {}
public static explicit operator Uuid(Guid @value) {}
public static bool operator > (Uuid x, Uuid y) {}
public static bool operator >= (Uuid x, Uuid y) {}
public static bool operator != (Uuid x, Uuid y) {}
public static bool operator < (Uuid x, Uuid y) {}
public static bool operator <= (Uuid x, Uuid y) {}
}
}
namespace Smdn.Formats.UniversallyUniqueIdentifiers {
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
public abstract class UuidGenerator {
protected UuidGenerator() {}
public static UuidGenerator CreateTimeBased() {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, Func<ushort> clockSequenceSource) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, Node node) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource, Node node) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence, Node node) {}
public abstract Uuid GenerateNext();
}
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public readonly struct Node : IFormattable {
public static Node CreateRandom() {}
public override string ToString() {}
public string ToString(string format, IFormatProvider formatProvider = null) {}
}
}
diff --git a/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard2.0.apilist.cs b/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard2.0.apilist.cs
index 17a03019..4e879e41 100644
--- a/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard2.0.apilist.cs
+++ b/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard2.0.apilist.cs
@@ -1,161 +1,161 @@
-// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.0.2)
+// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.0.3)
// Name: Smdn.Fundamental.Uuid
-// AssemblyVersion: 3.0.2.0
-// InformationalVersion: 3.0.2+3b6d4bbdb8e89104beed8bc83b9b240f09d0749d
+// AssemblyVersion: 3.0.3.0
+// InformationalVersion: 3.0.3+f2674783671f52cc107bf9220db31542d68751ae
// TargetFramework: .NETStandard,Version=v2.0
// Configuration: Release
using System;
using System.Net.NetworkInformation;
using System.Security.Cryptography;
using Smdn;
using Smdn.Formats.UniversallyUniqueIdentifiers;
namespace Smdn {
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
public enum UuidVersion : byte {
NameBasedMD5Hash = 3,
NameBasedSHA1Hash = 5,
None = 0,
RandomNumber = 4,
TimeBased = 1,
Version1 = 1,
Version2 = 2,
Version3 = 3,
Version4 = 4,
Version5 = 5,
}
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public readonly struct Uuid :
IComparable,
IComparable<Guid>,
IComparable<Uuid>,
IEquatable<Guid>,
IEquatable<Uuid>,
IFormattable
{
public enum Namespace : int {
RFC4122Dns = 1806153744,
RFC4122IsoOid = 1806153746,
RFC4122Url = 1806153745,
RFC4122X500 = 1806153748,
}
public enum Variant : byte {
MicrosoftReserved = 192,
NCSReserved = 0,
RFC4122 = 128,
Reserved = 224,
}
public static readonly Uuid Nil; // = "00000000-0000-0000-0000-000000000000"
public static readonly Uuid RFC4122NamespaceDns; // = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceIsoOid; // = "6ba7b812-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceUrl; // = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceX500; // = "6ba7b814-9dad-11d1-80b4-00c04fd430c8"
public Uuid(Guid guidValue) {}
public Uuid(ReadOnlySpan<byte> octets) {}
public Uuid(ReadOnlySpan<byte> octets, bool isBigEndian) {}
public Uuid(byte[] octets) {}
public Uuid(byte[] octets, bool isBigEndian) {}
public Uuid(byte[] octets, int index, bool isBigEndian = true) {}
public Uuid(string uuid) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, PhysicalAddress node) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte node0, byte node1, byte node2, byte node3, byte node4, byte node5) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte[] node) {}
public int Clock { get; }
public byte ClockSeqHighAndReserved { get; }
public byte ClockSeqLow { get; }
public string IEEE802MacAddress { get; }
public byte[] Node { get; }
public PhysicalAddress PhysicalAddress { get; }
public ushort TimeHighAndVersion { get; }
public uint TimeLow { get; }
public ushort TimeMid { get; }
public DateTime Timestamp { get; }
public Uuid.Variant VariantField { get; }
public UuidVersion Version { get; }
public int CompareTo(Guid other) {}
public int CompareTo(Uuid other) {}
public int CompareTo(object obj) {}
public static Uuid CreateFromRandomNumber() {}
public static Uuid CreateFromRandomNumber(RandomNumberGenerator rng) {}
public static Uuid CreateFromRandomNumber(ReadOnlySpan<byte> randomNumber) {}
public static Uuid CreateFromRandomNumber(byte[] randomNumber) {}
public static Uuid CreateNameBased(Uri url, UuidVersion version) {}
public static Uuid CreateNameBased(byte[] name, Uuid namespaceId, UuidVersion version) {}
public static Uuid CreateNameBased(byte[] name, Uuid.Namespace ns, UuidVersion version) {}
public static Uuid CreateNameBased(string name, Uuid namespaceId, UuidVersion version) {}
public static Uuid CreateNameBased(string name, Uuid.Namespace ns, UuidVersion version) {}
public static Uuid CreateNameBasedMD5(Uri url) {}
public static Uuid CreateNameBasedMD5(byte[] name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedMD5(string name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedSHA1(Uri url) {}
public static Uuid CreateNameBasedSHA1(byte[] name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedSHA1(string name, Uuid.Namespace ns) {}
public static Uuid CreateTimeBased() {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock) {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock, PhysicalAddress node) {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock, byte[] node) {}
public static Uuid CreateTimeBased(PhysicalAddress node) {}
public static Uuid CreateTimeBased(byte[] node) {}
public bool Equals(Guid other) {}
public bool Equals(Uuid other) {}
public override bool Equals(object obj) {}
public void GetBytes(byte[] buffer, int startIndex) {}
public void GetBytes(byte[] buffer, int startIndex, bool asBigEndian) {}
public override int GetHashCode() {}
public static Uuid NewUuid() {}
public byte[] ToByteArray() {}
public byte[] ToByteArray(bool asBigEndian) {}
public Guid ToGuid() {}
public override string ToString() {}
public string ToString(string format) {}
public string ToString(string format, IFormatProvider formatProvider) {}
public static bool operator == (Uuid x, Uuid y) {}
public static explicit operator Guid(Uuid @value) {}
public static explicit operator Uuid(Guid @value) {}
public static bool operator > (Uuid x, Uuid y) {}
public static bool operator >= (Uuid x, Uuid y) {}
public static bool operator != (Uuid x, Uuid y) {}
public static bool operator < (Uuid x, Uuid y) {}
public static bool operator <= (Uuid x, Uuid y) {}
}
}
namespace Smdn.Formats.UniversallyUniqueIdentifiers {
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
public abstract class UuidGenerator {
protected UuidGenerator() {}
public static UuidGenerator CreateTimeBased() {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, Func<ushort> clockSequenceSource) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, Node node) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, PhysicalAddress node) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource, Node node) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence, Node node) {}
public abstract Uuid GenerateNext();
}
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public readonly struct Node : IFormattable {
public Node(PhysicalAddress physicalAddress) {}
public static Node CreateRandom() {}
public PhysicalAddress ToPhysicalAddress() {}
public override string ToString() {}
public string ToString(string format, IFormatProvider formatProvider = null) {}
}
}
diff --git a/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard2.1.apilist.cs b/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard2.1.apilist.cs
index 765525df..5e4c78fe 100644
--- a/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard2.1.apilist.cs
+++ b/doc/api-list/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid-netstandard2.1.apilist.cs
@@ -1,161 +1,161 @@
-// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.0.2)
+// Smdn.Fundamental.Uuid.dll (Smdn.Fundamental.Uuid-3.0.3)
// Name: Smdn.Fundamental.Uuid
-// AssemblyVersion: 3.0.2.0
-// InformationalVersion: 3.0.2+3b6d4bbdb8e89104beed8bc83b9b240f09d0749d
+// AssemblyVersion: 3.0.3.0
+// InformationalVersion: 3.0.3+f2674783671f52cc107bf9220db31542d68751ae
// TargetFramework: .NETStandard,Version=v2.1
// Configuration: Release
using System;
using System.Net.NetworkInformation;
using System.Security.Cryptography;
using Smdn;
using Smdn.Formats.UniversallyUniqueIdentifiers;
namespace Smdn {
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
public enum UuidVersion : byte {
NameBasedMD5Hash = 3,
NameBasedSHA1Hash = 5,
None = 0,
RandomNumber = 4,
TimeBased = 1,
Version1 = 1,
Version2 = 2,
Version3 = 3,
Version4 = 4,
Version5 = 5,
}
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
[StructLayout(LayoutKind.Explicit, Pack = 1)]
public readonly struct Uuid :
IComparable,
IComparable<Guid>,
IComparable<Uuid>,
IEquatable<Guid>,
IEquatable<Uuid>,
IFormattable
{
public enum Namespace : int {
RFC4122Dns = 1806153744,
RFC4122IsoOid = 1806153746,
RFC4122Url = 1806153745,
RFC4122X500 = 1806153748,
}
public enum Variant : byte {
MicrosoftReserved = 192,
NCSReserved = 0,
RFC4122 = 128,
Reserved = 224,
}
public static readonly Uuid Nil; // = "00000000-0000-0000-0000-000000000000"
public static readonly Uuid RFC4122NamespaceDns; // = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceIsoOid; // = "6ba7b812-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceUrl; // = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"
public static readonly Uuid RFC4122NamespaceX500; // = "6ba7b814-9dad-11d1-80b4-00c04fd430c8"
public Uuid(Guid guidValue) {}
public Uuid(ReadOnlySpan<byte> octets) {}
public Uuid(ReadOnlySpan<byte> octets, bool isBigEndian) {}
public Uuid(byte[] octets) {}
public Uuid(byte[] octets, bool isBigEndian) {}
public Uuid(byte[] octets, int index, bool isBigEndian = true) {}
public Uuid(string uuid) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, PhysicalAddress node) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte node0, byte node1, byte node2, byte node3, byte node4, byte node5) {}
public Uuid(uint time_low, ushort time_mid, ushort time_hi_and_version, byte clock_seq_hi_and_reserved, byte clock_seq_low, byte[] node) {}
public int Clock { get; }
public byte ClockSeqHighAndReserved { get; }
public byte ClockSeqLow { get; }
public string IEEE802MacAddress { get; }
public byte[] Node { get; }
public PhysicalAddress PhysicalAddress { get; }
public ushort TimeHighAndVersion { get; }
public uint TimeLow { get; }
public ushort TimeMid { get; }
public DateTime Timestamp { get; }
public Uuid.Variant VariantField { get; }
public UuidVersion Version { get; }
public int CompareTo(Guid other) {}
public int CompareTo(Uuid other) {}
public int CompareTo(object obj) {}
public static Uuid CreateFromRandomNumber() {}
public static Uuid CreateFromRandomNumber(RandomNumberGenerator rng) {}
public static Uuid CreateFromRandomNumber(ReadOnlySpan<byte> randomNumber) {}
public static Uuid CreateFromRandomNumber(byte[] randomNumber) {}
public static Uuid CreateNameBased(Uri url, UuidVersion version) {}
public static Uuid CreateNameBased(byte[] name, Uuid namespaceId, UuidVersion version) {}
public static Uuid CreateNameBased(byte[] name, Uuid.Namespace ns, UuidVersion version) {}
public static Uuid CreateNameBased(string name, Uuid namespaceId, UuidVersion version) {}
public static Uuid CreateNameBased(string name, Uuid.Namespace ns, UuidVersion version) {}
public static Uuid CreateNameBasedMD5(Uri url) {}
public static Uuid CreateNameBasedMD5(byte[] name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedMD5(string name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedSHA1(Uri url) {}
public static Uuid CreateNameBasedSHA1(byte[] name, Uuid.Namespace ns) {}
public static Uuid CreateNameBasedSHA1(string name, Uuid.Namespace ns) {}
public static Uuid CreateTimeBased() {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock) {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock, PhysicalAddress node) {}
public static Uuid CreateTimeBased(DateTime timestamp, int clock, byte[] node) {}
public static Uuid CreateTimeBased(PhysicalAddress node) {}
public static Uuid CreateTimeBased(byte[] node) {}
public bool Equals(Guid other) {}
public bool Equals(Uuid other) {}
public override bool Equals(object obj) {}
public void GetBytes(byte[] buffer, int startIndex) {}
public void GetBytes(byte[] buffer, int startIndex, bool asBigEndian) {}
public override int GetHashCode() {}
public static Uuid NewUuid() {}
public byte[] ToByteArray() {}
public byte[] ToByteArray(bool asBigEndian) {}
public Guid ToGuid() {}
public override string ToString() {}
public string ToString(string format) {}
public string ToString(string format, IFormatProvider formatProvider) {}
public static bool operator == (Uuid x, Uuid y) {}
public static explicit operator Guid(Uuid @value) {}
public static explicit operator Uuid(Guid @value) {}
public static bool operator > (Uuid x, Uuid y) {}
public static bool operator >= (Uuid x, Uuid y) {}
public static bool operator != (Uuid x, Uuid y) {}
public static bool operator < (Uuid x, Uuid y) {}
public static bool operator <= (Uuid x, Uuid y) {}
}
}
namespace Smdn.Formats.UniversallyUniqueIdentifiers {
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
public abstract class UuidGenerator {
protected UuidGenerator() {}
public static UuidGenerator CreateTimeBased() {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, Func<ushort> clockSequenceSource) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, Node node) {}
public static UuidGenerator CreateTimeBased(DateTimeOffset timeStamp, int clockSequence, PhysicalAddress node) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, Func<ushort> clockSequenceSource, Node node) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence) {}
public static UuidGenerator CreateTimeBased(Func<ulong> timeStampSource, int clockSequence, Node node) {}
public abstract Uuid GenerateNext();
}
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public readonly struct Node : IFormattable {
public Node(PhysicalAddress physicalAddress) {}
public static Node CreateRandom() {}
public PhysicalAddress ToPhysicalAddress() {}
public override string ToString() {}
public string ToString(string format, IFormatProvider formatProvider = null) {}
}
}
diff --git a/src/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid.csproj b/src/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid.csproj
index f6b95b67..7e64aa3a 100644
--- a/src/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid.csproj
+++ b/src/Smdn.Fundamental.Uuid/Smdn.Fundamental.Uuid.csproj
@@ -5,7 +5,7 @@ SPDX-License-Identifier: MIT
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;net45;netstandard2.1;netstandard2.0;netstandard1.6</TargetFrameworks>
- <VersionPrefix>3.0.2</VersionPrefix>
+ <VersionPrefix>3.0.3</VersionPrefix>
<VersionSuffix></VersionSuffix>
<PackageValidationBaselineVersion>3.0.0</PackageValidationBaselineVersion>
</PropertyGroup>
diff --git a/src/Smdn.Fundamental.Uuid/Smdn/Uuid.cs b/src/Smdn.Fundamental.Uuid/Smdn/Uuid.cs
index f8211228..546fbdde 100644
--- a/src/Smdn.Fundamental.Uuid/Smdn/Uuid.cs
+++ b/src/Smdn.Fundamental.Uuid/Smdn/Uuid.cs
@@ -74,7 +74,7 @@ public readonly struct Uuid :
private static DateTime GetTimestamp() => throw new NotImplementedException();
#if SYSTEM_NET_NETWORKINFORMATION_PHYSICALADDRESS
- private static PhysicalAddress GetNode()
+ private static Node GetNode()
{
var nic = Array.Find(NetworkInterface.GetAllNetworkInterfaces(), delegate(NetworkInterface networkInterface) {
return networkInterface.NetworkInterfaceType != NetworkInterfaceType.Loopback;
@@ -83,49 +83,78 @@ public readonly struct Uuid :
if (nic == null)
throw new NotSupportedException("network interface not found");
- return nic.GetPhysicalAddress();
+ var physicalAddress = nic.GetPhysicalAddress().GetAddressBytes().AsSpan();
+
+ if (6 < physicalAddress.Length)
+ physicalAddress = physicalAddress.Slice(0, 6);
+
+ Span<byte> node = stackalloc byte[6];
+
+ physicalAddress.CopyTo(node);
+
+ return new Node(node);
}
public static Uuid CreateTimeBased()
- => CreateTimeBased(
+ => CreateTimeBasedCore(
GetTimestamp(),
GetClock(),
GetNode()
);
public static Uuid CreateTimeBased(DateTime timestamp, int clock)
- => CreateTimeBased(
+ => CreateTimeBasedCore(
timestamp,
clock,
GetNode()
);
- public static Uuid CreateTimeBased(PhysicalAddress node)
- {
- if (node == null)
- throw new ArgumentNullException(nameof(node));
+ private static Node ToNode(PhysicalAddress node, string paramName)
+ => ToNode(
+ (node ?? throw new ArgumentNullException(paramName)).GetAddressBytes(),
+ paramName
+ );
- return CreateTimeBased(node.GetAddressBytes());
- }
+ public static Uuid CreateTimeBased(PhysicalAddress node)
+ => CreateTimeBasedCore(
+ GetTimestamp(),
+ GetClock(),
+ ToNode(node, nameof(node))
+ );
public static Uuid CreateTimeBased(DateTime timestamp, int clock, PhysicalAddress node)
+ => CreateTimeBasedCore(
+ timestamp,
+ clock,
+ ToNode(node, nameof(node))
+ );
+#endif
+
+ private static Node ToNode(byte[] node, string paramName)
{
- if (node == null)
- throw new ArgumentNullException(nameof(node));
+ if (node is null)
+ throw new ArgumentNullException(paramName);
+ if (node.Length != 6)
+ throw new ArgumentException("must be 48-bit length", paramName);
- return CreateTimeBased(timestamp, clock, node.GetAddressBytes());
+ return new Node(node);
}
-#endif
public static Uuid CreateTimeBased(byte[] node)
- {
- return CreateTimeBased(
+ => CreateTimeBasedCore(
GetTimestamp(),
GetClock(),
- node);
- }
+ ToNode(node, nameof(node))
+ );
public static Uuid CreateTimeBased(DateTime timestamp, int clock, byte[] node)
+ => CreateTimeBasedCore(
+ timestamp,
+ clock,
+ ToNode(node, nameof(node))
+ );
+
+ private static Uuid CreateTimeBasedCore(DateTime timestamp, int clock, Node node)
{
/*
* 4.2. Algorithms for Creating a Time-Based UUID
@@ -150,16 +179,11 @@ public readonly struct Uuid :
if (clock is < 0 or >= 0x3fff)
throw new ArgumentOutOfRangeException(nameof(clock), clock, "must be 14-bit unsigned integer");
- if (node == null)
- throw new ArgumentNullException(nameof(node));
- if (node.Length != 6)
- throw new ArgumentException("must be 48-bit length", nameof(node));
-
return new Uuid(
version: UuidVersion.Version1,
time: (ulong)timestamp.Subtract(timestampEpoch).Ticks,
clock_seq: (ushort)clock,
- node: new Node(node)
+ node: node
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment