Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dailydevops/sequentialguid
Simple and high-performance solution for creating sequential GUIDs. Does not fulfill the security requirements like GUIDs.
https://github.com/dailydevops/sequentialguid
dotnet sequential-guids
Last synced: about 1 month ago
JSON representation
Simple and high-performance solution for creating sequential GUIDs. Does not fulfill the security requirements like GUIDs.
- Host: GitHub
- URL: https://github.com/dailydevops/sequentialguid
- Owner: dailydevops
- License: mit
- Created: 2024-04-02T10:35:39.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-11-23T20:43:51.000Z (about 2 months ago)
- Last Synced: 2024-11-23T21:26:48.782Z (about 2 months ago)
- Topics: dotnet, sequential-guids
- Language: C#
- Homepage: https://dailydevops.net
- Size: 136 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# NetEvolve.SequentialGuid
[![Nuget](https://img.shields.io/nuget/v/NetEvolve.SequentialGuid?logo=nuget)](https://www.nuget.org/packages/NetEvolve.SequentialGuid/)
[![Nuget](https://img.shields.io/nuget/dt/NetEvolve.SequentialGuid?logo=nuget)](https://www.nuget.org/packages/NetEvolve.SequentialGuid/)A .NET library to generate sequential GUIDs, similar to SQL Server's `newsequentialid()`.
It's a drop-in replacement for `System.Guid.NewGuid()`, focusing on performance and low allocation.> [!CAUTION]
> The downside is that it's not as unique as `System.Guid.NewGuid()` and crypotographically insecure.
> So be sure to understand the trade-offs before using it.## Features
With the `SequentialGuidType` enum, you can choose between 3 different types of sequential GUIDs:
- `AsBinary`
The sequential part is at the beginning of the GUID, similar to Oracle's `SYS_GUID()`.
- `AsString` (Default)
The sequential part is at the beginning of the GUID.
- `AtEnd`
The sequential part is at the end of the GUID, similar to SQL Server's `newsequentialid()`.## Installation
```pwsh
dotnet add package NetEvolve.SequentialGuid
```## Usage
```csharp
using NetEvolve.SequentialGuid;Guid guid = SequentialGuidFactory.NewGuid(); // Default is SequentialGuidType.AsString
// or
Guid guid = SequentialGuidFactory.NewGuid(SequentialGuidType.AsBinary);
```