Sign in Sign up
nuget

CSharpVitamins.ShortGuid

A convenience wrapper struct for dealing with URL-safe Base64 encoded globally unique identifiers (GUID), making a shorter string value (22 vs 36 characters long). As of version 2.0.0, `ShortGuid` performs a sanity check when decoding strings to ensure they haven't been tampered with, i.e. allowing the end of a Base64 string to be tweaked where it still produces that same byte array to create the underlying Guid. Effectively there is "unused space" in the Base64 string which is ignored, but will now result in an `FormatException` being thrown. ShortGuid will never produce an invalid string, however if one is supplied, it could result in an unintended collision where multiple URL-safe Base64 strings can point to the same Guid. To avoid this uncertainty, a round-trip check is performed to ensure a 1-1 match with the input string. Stick with version 1.1.0 if you require the old behaviour with opt-in strict parsing.

nuget View on Nuget

Activity

Latest release
5y ago
Total releases
4
Cadence
~6 months
Last 12 months
0

Details

First release
Nov 22, 2019
Releases
Version Released
2.0.0 major
1.1.0 minor
1.0.2 patch
1.0.1 initial