{"id":16366079,"url":"https://github.com/bgrainger/nguid","last_synced_at":"2025-03-23T02:32:33.662Z","repository":{"id":177738359,"uuid":"660833411","full_name":"bgrainger/NGuid","owner":"bgrainger","description":".NET Library for creating GUIDs according to RFC 4122 and draft-ietf-uuidrev","archived":false,"fork":false,"pushed_at":"2024-02-19T11:26:48.000Z","size":128,"stargazers_count":7,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-02T21:13:35.388Z","etag":null,"topics":["csharp","dotnet","guid","uuid"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bgrainger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-01T01:18:59.000Z","updated_at":"2024-04-19T08:49:29.000Z","dependencies_parsed_at":"2024-10-11T02:45:21.502Z","dependency_job_id":"6d5f0a6e-9723-4a90-8243-aa8937203914","html_url":"https://github.com/bgrainger/NGuid","commit_stats":null,"previous_names":["bgrainger/nguid"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgrainger%2FNGuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgrainger%2FNGuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgrainger%2FNGuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgrainger%2FNGuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgrainger","download_url":"https://codeload.github.com/bgrainger/NGuid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221842671,"owners_count":16890174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","guid","uuid"],"created_at":"2024-10-11T02:45:16.868Z","updated_at":"2024-10-28T14:46:05.011Z","avatar_url":"https://github.com/bgrainger.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NGuid\n\n[![Continuous Integration](https://github.com/bgrainger/NGuid/actions/workflows/ci.yaml/badge.svg)](https://github.com/bgrainger/NGuid/actions/workflows/ci.yaml)\n[![NuGet](https://img.shields.io/nuget/v/NGuid)](https://www.nuget.org/packages/NGuid)\n\n## About\n\nNGuid provides efficient creation of name-based, time-based, and random GUIDs according to\n[RFC 4122](https://www.rfc-editor.org/rfc/rfc4122)\nand [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562):\n\n* Version 3 ‒ created from an MD5 hash of a name\n* Version 5 ‒ created from a SHA1 hash of a name\n* Version 6 ‒ a field-compatible version of UUIDv1, reordered for improved DB locality\n* Version 7 ‒ a time-ordered value based on a Unix timestamp\n* Version 8 ‒ an RFC-compatible format for experimental or vendor-specific use cases\n\n## Usage\n\n```csharp\n// returns a \"Version 5\" UUID by default: {74738ff5-5367-5958-9aee-98fffdcd1876}\nvar guidv5 = GuidHelpers.CreateFromName(GuidHelpers.DnsNamespace, \"www.example.org\"u8);\n\n// can also create \"Version 3\": {0012416f-9eec-3ed4-a8b0-3bceecde1cd9}\nvar guidv3 = GuidHelpers.CreateFromName(GuidHelpers.DnsNamespace, \"www.example.org\"u8, version: 3);\n\n// converts {6ba7b810-9dad-11d1-80b4-00c04fd430c8} to {1d19dad6-ba7b-6810-80b4-00c04fd430c8}\nvar guidv6 = GuidHelpers.CreateVersion6FromVersion1(GuidHelpers.DnsNamespace);\n\n// creates a v7 GUID using the current time and random data\nvar guidv7 = GuidHelpers.CreateVersion7();\n\n// .NET 8 only: specify a TimeProvider to provide the timestamp\nvar guidv7WithTime = GuidHelpers.CreateVersion7(TimeProvider.System);\n\n// creates a v8 GUID using the specified data\nReadOnlySpan\u003cbyte\u003e bytes = GetBytesFromSomewhere();\nvar guidv8 = GuidHelpers.CreateVersion8(bytes);\n\n// creates a name-based v8 GUID using the specified hash algorithm\nvar guidv8ForName = GuidHelpers.CreateVersion8FromName(HashAlgorithmName.SHA256,\n    GuidHelpers.DnsNamespace, \"www.example.com\"u8);\n```\n\n## License\n\n[MIT](https://github.com/bgrainger/NGuid/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgrainger%2Fnguid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgrainger%2Fnguid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgrainger%2Fnguid/lists"}