Skip to content

Commit 447e448

Browse files
committed
Migration to Organisation TensionDev
Namespaces have also been updated accordingly.
1 parent 92f1452 commit 447e448

6 files changed

Lines changed: 54 additions & 24 deletions

File tree

.github/workflows/package-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ jobs:
5050
- name: Push GitHub
5151
run: dotnet nuget push "UUIDUtil/bin/Release/*.nupkg" --no-symbols --skip-duplicate
5252

53-
# - name: Push NuGet
54-
# run: dotnet nuget push "UUIDUtil/bin/Release/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }} --no-symbols --skip-duplicate
53+
- name: Push NuGet
54+
run: dotnet nuget push "UUIDUtil/bin/Release/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_TOKEN }} --no-symbols --skip-duplicate

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# TensionDev.UUID
2+
3+
# Changelog
4+
All notable changes to this project will be documented in this file.
5+
6+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8+
9+
## [Unreleased]
10+
11+
12+
## [v0.1.1-alpha] - 2021-09-08
13+
[v0.1.1-alpha](https://github.com/TensionDev/UUIDUtil/releases/tag/v0.1.1-alpha)
14+
15+
### Fixed
16+
- Fixed Variant Field for generated UUID v1 to be of the correct range. (0x8xxx - 0xbxxx)
17+
18+
19+
## [v0.1.0-alpha] - 2021-09-04
20+
[v0.1.0-alpha](https://github.com/TensionDev/UUIDUtil/releases/tag/v0.1.0-alpha)
21+
22+
### Added
23+
- Added UUID v1 generated based on current system date and time as well as local Network MAC Address.
24+
- Added UUID v1 generated based on current system date and time as well as supplied Network MAC Address.
25+
- Added UUID v1 generated based on supplied system date and time as well as local Network MAC Address.
26+
- Added UUID v1 generated based on supplied system date and time as well as supplied Network MAC Address.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# UUID Library
1+
# TensionDev.UUID
22

3-
[![.NET](https://github.com/amsga/UUIDUtil/actions/workflows/dotnet.yml/badge.svg)](https://github.com/amsga/UUIDUtil/actions/workflows/dotnet.yml)
4-
[![Package Release](https://github.com/amsga/UUIDUtil/actions/workflows/package-release.yml/badge.svg)](https://github.com/amsga/UUIDUtil/actions/workflows/package-release.yml)
3+
[![.NET](https://github.com/TensionDev/UUIDUtil/actions/workflows/dotnet.yml/badge.svg)](https://github.com/TensionDev/UUIDUtil/actions/workflows/dotnet.yml)
4+
[![Package Release](https://github.com/TensionDev/UUIDUtil/actions/workflows/package-release.yml/badge.svg)](https://github.com/TensionDev/UUIDUtil/actions/workflows/package-release.yml)
55

66
A project to store UUID functions within a library for future use.
77
This project references the following documents for implementation.

UUIDUtil/UUIDUtil.csproj

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5+
<AssemblyName>TensionDev.UUID</AssemblyName>
6+
<RootNamespace>TensionDev.UUID</RootNamespace>
7+
<PackageId>TensionDev.UUID</PackageId>
8+
<Product>TensionDev.UUID</Product>
59
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
610
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
7-
<Authors>amsga</Authors>
11+
<Company>TensionDev</Company>
12+
<Authors>TensionDev amsga</Authors>
813
<NeutralLanguage>en-SG</NeutralLanguage>
9-
<Description>A project to store UUID functions within a library for future use.</Description>
10-
<Copyright>Copyright (c) amsga 2021</Copyright>
14+
<Description>A project to store various UUID functions within a library for future use.</Description>
15+
<Copyright>Copyright (c) TensionDev 2021</Copyright>
1116
<PackageTags>UUID GUID</PackageTags>
1217
<PackageReleaseNotes>Initial Release with UUID / GUID Version 1</PackageReleaseNotes>
13-
<PackageProjectUrl>https://github.com/amsga/UUIDUtil</PackageProjectUrl>
14-
<RepositoryUrl>https://github.com/amsga/UUIDUtil</RepositoryUrl>
18+
<PackageProjectUrl>https://github.com/TensionDev/UUIDUtil</PackageProjectUrl>
19+
<RepositoryUrl>https://github.com/TensionDev/UUIDUtil</RepositoryUrl>
1520
<RepositoryType>git</RepositoryType>
16-
<Version>0.1.1-alpha</Version>
21+
<Version>0.1.1-beta</Version>
1722
<AssemblyVersion>0.1.0.0</AssemblyVersion>
1823
<FileVersion>0.1.1.0</FileVersion>
1924
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>

UUIDUtil/UUIDv1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace UUIDUtil
3+
namespace TensionDev.UUID
44
{
55
/// <summary>
66
/// Class Library to generate Universally Unique Identifier (UUID) / Globally Unique Identifier (GUID) based on Version 1 (date-time and MAC address).

XUnitTestProjectUUID/UnitTestUUIDv1.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public void TestGetNodeID()
1919
expectedNodeIDs.Add(nic.GetPhysicalAddress().GetAddressBytes());
2020
}
2121

22-
byte[] nodeID = UUIDUtil.UUIDv1.GetNodeID();
22+
byte[] nodeID = TensionDev.UUID.UUIDv1.GetNodeID();
2323

2424
if (nics.Length > 0)
2525
Assert.Contains(nodeID, expectedNodeIDs);
@@ -30,8 +30,8 @@ public void TestGetNodeID()
3030
[Fact]
3131
public void TestConsistentGetNodeID()
3232
{
33-
byte[] nodeID1 = UUIDUtil.UUIDv1.GetNodeID();
34-
byte[] nodeID2 = UUIDUtil.UUIDv1.GetNodeID();
33+
byte[] nodeID1 = TensionDev.UUID.UUIDv1.GetNodeID();
34+
byte[] nodeID2 = TensionDev.UUID.UUIDv1.GetNodeID();
3535

3636
Assert.Equal(nodeID1, nodeID2);
3737
}
@@ -44,7 +44,7 @@ public void TestNewUUIDv1()
4444
byte[] nodeID = new byte[] { 0x02, 0x42, 0xac, 0x13, 0x00, 0x03 };
4545
byte[] clockSequence = new byte[] { 0x82, 0xa8 };
4646
DateTime dateTime = DateTime.Parse("2021-09-03T05:37:54.619630Z");
47-
Guid uuid = UUIDUtil.UUIDv1.NewUUIDv1(dateTime, clockSequence, nodeID);
47+
Guid uuid = TensionDev.UUID.UUIDv1.NewUUIDv1(dateTime, clockSequence, nodeID);
4848

4949
Assert.Equal(expectedUUID, uuid);
5050
}
@@ -58,7 +58,7 @@ public void TestGetClockSequence()
5858
Parallel.For(0, UInt16.MaxValue,
5959
clock =>
6060
{
61-
Byte[] vs = UUIDUtil.UUIDv1.GetClockSequence();
61+
Byte[] vs = TensionDev.UUID.UUIDv1.GetClockSequence();
6262
Int16 networkorder = BitConverter.ToInt16(vs);
6363
UInt16 key = (UInt16)System.Net.IPAddress.NetworkToHostOrder(networkorder);
6464
concurrentDictionary.TryAdd(key, true);
@@ -78,12 +78,11 @@ public void TestUUIDVariantField()
7878
IList<char> expectedVariantField = new List<char>() { '8', '9', 'a', 'b' };
7979

8080
ConcurrentBag<String> concurrentBag = new ConcurrentBag<String>();
81-
Int32 expectedMaxSequence = 0x4000;
8281

8382
Parallel.For(0, UInt16.MaxValue,
8483
body =>
8584
{
86-
concurrentBag.Add(UUIDUtil.UUIDv1.NewUUIDv1().ToString());
85+
concurrentBag.Add(TensionDev.UUID.UUIDv1.NewUUIDv1().ToString());
8786
});
8887

8988
foreach (String value in concurrentBag)
@@ -97,31 +96,31 @@ public void TestNewUUIDv1NullClockSequence()
9796
{
9897
byte[] nodeID = new byte[] { 0x02, 0x42, 0xac, 0x13, 0x00, 0x03 };
9998
byte[] clockSequence = null;
100-
Assert.Throws<ArgumentNullException>(() => UUIDUtil.UUIDv1.NewUUIDv1(DateTime.UtcNow, clockSequence, nodeID));
99+
Assert.Throws<ArgumentNullException>(() => TensionDev.UUID.UUIDv1.NewUUIDv1(DateTime.UtcNow, clockSequence, nodeID));
101100
}
102101

103102
[Fact]
104103
public void TestNewUUIDv1ReducedClockSequence()
105104
{
106105
byte[] nodeID = new byte[] { 0x02, 0x42, 0xac, 0x13, 0x00, 0x03 };
107106
byte[] clockSequence = new byte[] { 0x82 };
108-
Assert.Throws<ArgumentException>(() => UUIDUtil.UUIDv1.NewUUIDv1(DateTime.UtcNow, clockSequence, nodeID));
107+
Assert.Throws<ArgumentException>(() => TensionDev.UUID.UUIDv1.NewUUIDv1(DateTime.UtcNow, clockSequence, nodeID));
109108
}
110109

111110
[Fact]
112111
public void TestNewUUIDv1NullNodeID()
113112
{
114113
byte[] nodeID = null;
115114
byte[] clockSequence = new byte[] { 0x82, 0xa8 };
116-
Assert.Throws<ArgumentNullException>(() => UUIDUtil.UUIDv1.NewUUIDv1(DateTime.UtcNow, clockSequence, nodeID));
115+
Assert.Throws<ArgumentNullException>(() => TensionDev.UUID.UUIDv1.NewUUIDv1(DateTime.UtcNow, clockSequence, nodeID));
117116
}
118117

119118
[Fact]
120119
public void TestNewUUIDv1ReducedNodeID()
121120
{
122121
byte[] nodeID = new byte[] { 0x02, 0x42, 0xac, 0x13 };
123122
byte[] clockSequence = new byte[] { 0x82, 0xa8 };
124-
Assert.Throws<ArgumentException>(() => UUIDUtil.UUIDv1.NewUUIDv1(DateTime.UtcNow, clockSequence, nodeID));
123+
Assert.Throws<ArgumentException>(() => TensionDev.UUID.UUIDv1.NewUUIDv1(DateTime.UtcNow, clockSequence, nodeID));
125124
}
126125
}
127126
}

0 commit comments

Comments
 (0)