Skip to content

Bump Microsoft.NET.Test.Sdk from 17.12.0 to 17.13.0 #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v2.1.0] - 2024-06-05
[v2.1.0](https://github.com/TensionDev/UUIDUtil/releases/tag/v2.1.0)

### Changed
- Changed Classes to static with private fields.


## [v2.1.0] - 2024-06-05
[v2.1.0](https://github.com/TensionDev/UUIDUtil/releases/tag/v2.1.0)

Expand Down
2 changes: 1 addition & 1 deletion UUIDUtil/UUIDUtil.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageId>TensionDev.UUID</PackageId>
<Version>2.1.1</Version>
<Version>2.2.0</Version>
<Authors>TensionDev amsga</Authors>
<Company>TensionDev</Company>
<Product>TensionDev.UUID</Product>
Expand Down
16 changes: 6 additions & 10 deletions UUIDUtil/UUIDv1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ namespace TensionDev.UUID
/// <summary>
/// Class Library to generate Universally Unique Identifier (UUID) / Globally Unique Identifier (GUID) based on Version 1 (date-time and MAC address).
/// </summary>
public class UUIDv1
public static class UUIDv1
{
protected internal static System.Net.NetworkInformation.PhysicalAddress s_physicalAddress = System.Net.NetworkInformation.PhysicalAddress.None;
protected internal static Int32 s_clock = Int32.MinValue;
protected internal static readonly DateTime s_epoch = new DateTime(1582, 10, 15, 0, 0, 0, DateTimeKind.Utc);
private static System.Net.NetworkInformation.PhysicalAddress s_physicalAddress = System.Net.NetworkInformation.PhysicalAddress.None;
private static Int32 s_clock = Int32.MinValue;
private static readonly DateTime s_epoch = new DateTime(1582, 10, 15, 0, 0, 0, DateTimeKind.Utc);

protected internal static readonly Object s_initLock = new Object();
protected internal static readonly Object s_clockLock = new Object();

protected UUIDv1()
{
}
private static readonly Object s_initLock = new Object();
private static readonly Object s_clockLock = new Object();

/// <summary>
/// Initialises a new GUID/UUID based on Version 1 (date-time and MAC address)
Expand Down
6 changes: 1 addition & 5 deletions UUIDUtil/UUIDv3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ namespace TensionDev.UUID
/// <summary>
/// Class Library to generate Universally Unique Identifier (UUID) / Globally Unique Identifier (GUID) based on Version 3 (MD5 namespace name-based).
/// </summary>
public class UUIDv3
public static class UUIDv3
{
protected UUIDv3()
{
}

/// <summary>
/// Initialises a new GUID/UUID based on Version 3 (MD5 namespace name-based)
/// </summary>
Expand Down
6 changes: 1 addition & 5 deletions UUIDUtil/UUIDv4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ namespace TensionDev.UUID
/// <summary>
/// Class Library to generate Universally Unique Identifier (UUID) / Globally Unique Identifier (GUID) based on Version 4 (random).
/// </summary>
public class UUIDv4
public static class UUIDv4
{
protected UUIDv4()
{
}

/// <summary>
/// Initialises a new GUID/UUID based on Version 4 (random)
/// </summary>
Expand Down
6 changes: 1 addition & 5 deletions UUIDUtil/UUIDv5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ namespace TensionDev.UUID
/// <summary>
/// Class Library to generate Universally Unique Identifier (UUID) / Globally Unique Identifier (GUID) based on Version 5 (SHA-1 namespace name-based).
/// </summary>
public class UUIDv5
public static class UUIDv5
{
protected UUIDv5()
{
}

/// <summary>
/// Initialises a new GUID/UUID based on Version 5 (SHA-1 namespace name-based)
/// </summary>
Expand Down
14 changes: 5 additions & 9 deletions UUIDUtil/UUIDv6.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ namespace TensionDev.UUID
/// <summary>
/// Class Library to generate Universally Unique Identifier (UUID) / Globally Unique Identifier (GUID) based on Version 6 (date-time).
/// </summary>
public class UUIDv6
public static class UUIDv6
{
protected internal static Int32 s_clock = Int32.MinValue;
protected internal static readonly DateTime s_epoch = new DateTime(1582, 10, 15, 0, 0, 0, DateTimeKind.Utc);
private static Int32 s_clock = Int32.MinValue;
private static readonly DateTime s_epoch = new DateTime(1582, 10, 15, 0, 0, 0, DateTimeKind.Utc);

protected internal static readonly Object s_initLock = new Object();
protected internal static readonly Object s_clockLock = new Object();

protected UUIDv6()
{
}
private static readonly Object s_initLock = new Object();
private static readonly Object s_clockLock = new Object();

/// <summary>
/// Initialises a new GUID/UUID based on Version 6 (date-time)
Expand Down
12 changes: 4 additions & 8 deletions UUIDUtil/UUIDv7.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ namespace TensionDev.UUID
/// <summary>
/// Class Library to generate Universally Unique Identifier (UUID) / Globally Unique Identifier (GUID) based on Version 7 (date-time).
/// </summary>
public class UUIDv7
public static class UUIDv7
{
protected internal static readonly DateTime s_epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
private static readonly DateTime s_epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

protected internal static UInt16 s_counter = 0;
protected internal static readonly Object s_counterLock = new Object();

protected UUIDv7()
{
}
private static UInt16 s_counter = 0;
private static readonly Object s_counterLock = new Object();

public enum GenerationMethod
{
Expand Down
16 changes: 7 additions & 9 deletions UUIDUtil/Uuid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public sealed class Uuid : IComparable<Uuid>, IEquatable<Uuid>
private readonly uint _time_low;
private readonly ushort _time_mid;
private readonly ushort _time_hi_and_version;
private byte _clock_seq_hi_and_reserved;
private readonly byte _clock_seq_hi_and_reserved;
private readonly byte _clock_seq_low;
private readonly byte[] _node;

Expand Down Expand Up @@ -355,10 +355,9 @@ public Guid ToVariant2()
{
byte newClockSeq = (byte)(_clock_seq_hi_and_reserved & 0x1F);
newClockSeq = (byte)(newClockSeq | 0xC0);
Uuid variant2 = new Uuid(this.ToByteArray())
{
_clock_seq_hi_and_reserved = newClockSeq
};
byte[] array = ToByteArray();
array[8] = newClockSeq;
Uuid variant2 = new Uuid(array);

return variant2.ToGuid();
}
Expand All @@ -373,10 +372,9 @@ public static Uuid ToVariant1(Guid guid)
Uuid variant2 = new Uuid(guid.ToString());
byte newClockSeq = (byte)(variant2._clock_seq_hi_and_reserved & 0x3F);
newClockSeq = (byte)(newClockSeq | 0x80);
Uuid variant1 = new Uuid(variant2.ToByteArray())
{
_clock_seq_hi_and_reserved = newClockSeq
};
byte[] array = variant2.ToByteArray();
array[8] = newClockSeq;
Uuid variant1 = new Uuid(array);

return variant1;
}
Expand Down
Loading
Loading