Skip to content

Commit

Permalink
Add NuGet package README and metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Jul 2, 2023
1 parent 309c4db commit c12aa64
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<UseArtifactsOutput>true</UseArtifactsOutput>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/bgrainger/NGuid/</PackageProjectUrl>
<PackageReleaseNotes>https://github.com/bgrainger/NGuid/blob/master/ReleaseNotes.md</PackageReleaseNotes>
<PackageIconUrl>https://github.com/bgrainger/NGuid/blob/master/NGuid.png</PackageIconUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/bgrainger/NGuid.git</RepositoryUrl>
<DebugType>embedded</DebugType>
Expand All @@ -22,6 +25,8 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<MinVerDefaultPreReleaseIdentifiers>beta.0</MinVerDefaultPreReleaseIdentifiers>
<Authors>Bradley Grainger</Authors>
<Copyright>Copyright 2023 Bradley Grainger</Copyright>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
Expand Down
Binary file added NGuid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# NGuid

[![Continuous Integration](https://github.com/bgrainger/NGuid/actions/workflows/ci.yaml/badge.svg)](https://github.com/bgrainger/NGuid/actions/workflows/ci.yaml)

## About

NGuid provides efficient creation of name-based GUIDs according to [RFC4122](https://datatracker.ietf.org/doc/html/rfc4122):

* Version 3 - created from an MD5 hash of a name
* Version 5 (default) - created from a SHA1 hash of a name

## Usage

```csharp
// returns a "Version 5" UUID by default: {74738ff5-5367-5958-9aee-98fffdcd1876}
var guid = GuidHelpers.CreateFromName(GuidHelpers.DnsNamespace, "www.example.org"u8);

// can also create "Version 3": {0012416f-9eec-3ed4-a8b0-3bceecde1cd9}
var guidv3 = GuidHelpers.CreateFromName(GuidHelpers.DnsNamespace, "www.example.org"u8, version: 3);
```

## License

[MIT](https://github.com/bgrainger/NGuid/blob/master/LICENSE)
6 changes: 6 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Release Notes

## 0.1.0

* First public release.
* Provide `GuidHelpers.CreateFromName` to create Version 3 and Version 5 UUIDs.
11 changes: 10 additions & 1 deletion src/NGuid/NGuid.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Description>Creates GUIDs according to RFC4122.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>guid;uuid;rfc4122</PackageTags>
<PackageIcon>NGuid.png</PackageIcon>
</PropertyGroup>

<ItemGroup>
Expand All @@ -11,4 +15,9 @@
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="..\..\NGuid.png" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
16 changes: 16 additions & 0 deletions src/NGuid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## NGuid

NGuid provides efficient creation of name-based GUIDs according to [RFC4122](https://datatracker.ietf.org/doc/html/rfc4122):

* Version 3 - created from an MD5 hash of a name
* Version 5 (default) - created from a SHA1 hash of a name

## Usage

```csharp
// returns a "Version 5" UUID by default: {74738ff5-5367-5958-9aee-98fffdcd1876}
var guid = GuidHelpers.CreateFromName(GuidHelpers.DnsNamespace, "www.example.org"u8);

// can also create "Version 3": {0012416f-9eec-3ed4-a8b0-3bceecde1cd9}
var guidv3 = GuidHelpers.CreateFromName(GuidHelpers.DnsNamespace, "www.example.org"u8, version: 3);
```

0 comments on commit c12aa64

Please sign in to comment.