Guint 1.1.5
See the version list below for details.
dotnet add package Guint --version 1.1.5
NuGet\Install-Package Guint -Version 1.1.5
<PackageReference Include="Guint" Version="1.1.5" />
<PackageVersion Include="Guint" Version="1.1.5" />
<PackageReference Include="Guint" />
paket add Guint --version 1.1.5
#r "nuget: Guint, 1.1.5"
#:package Guint@1.1.5
#addin nuget:?package=Guint&version=1.1.5
#tool nuget:?package=Guint&version=1.1.5
Guint
Sure! int
's make pretty primary keys! They're fast! Easy to share! Easy to communicate!
Yes, but...
- Now I can enumerate your primary keys. One little authorization oversight and all your data are belong to me, thank you
- And, ha! all your competitors and future investors can exactly see how many records you actually have, thanks again!
- And, no proper Ports and Adapters-, Hexagonal-, Union- or Clean Architecure for you, my friend, with your database dictating id's. Back to 2005 🦕 do not collect $200 👋
So what should I do?
Change the primary key to Guid
But I can't!*
Then, use Guint
Take your int
and transform it to an Guid
and the other way around. So have your int
as a primary key in your database, but expose it as a Guid
In other words: Have your cake and eat it too!
Show me how
public Task<IHttpActionResult> Get(Guid id)
{
var i = id.DecryptToInt(key, vector);
return i.HasValue
? Ok(this.carService.Get(i))
: NotFound();
}
To obtain a valid key and vector, run
(var key, var vector) = Guint.Guint.GenerateKeyAndInitializationVector();
Or go to https://dotnetfiddle.net/z8FFmN and run it there
* For reasons!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
2.0.1 | 221 | 2/12/2024 |
2.0.0 | 391 | 2/9/2024 |
2.0.0-beta.5 | 86 | 2/9/2024 |
2.0.0-beta.4 | 130 | 2/8/2024 |
2.0.0-beta.3 | 80 | 2/8/2024 |
2.0.0-beta.2 | 85 | 2/6/2024 |
2.0.0-beta.1 | 80 | 2/2/2024 |
1.1.5 | 819 | 3/25/2022 |
1.1.4 | 545 | 3/25/2022 |
1.1.3 | 540 | 3/24/2022 |
1.1.2 | 544 | 2/17/2022 |
1.1.1 | 571 | 2/14/2022 |
1.1.0 | 573 | 1/24/2022 |
1.0.0 | 531 | 1/21/2022 |