Evoke.Components.ShortGuids 1.0.1

Generate URL-safe, user-friendly, concise, unambiguous, GUIDs

Install-Package Evoke.Components.ShortGuids -Version 1.0.1
dotnet add package Evoke.Components.ShortGuids --version 1.0.1
<PackageReference Include="Evoke.Components.ShortGuids" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Evoke.Components.ShortGuids --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Screenshot

DownloadCounter
GitHub
BuildTarget

Introduction

Often, one needs to use non-sequential IDs in places where users will see them, but the IDs must be as concise and easy to use as possible. ShortGuids solves this problem by translating generated Guids to base57 using lowercase and uppercase letters and digits, and removing similar-looking characters such as l, 1, I, O and 0.

This package is maintained by @ruudschuurmans.
This is a .NET port of the shortuuid PHP library by Pascal de Vink

Goals

  • Provide a .NET Standard 2.0 port of the shortuuid PHP library
  • Encode Guids to user friendly ShortGuids for displaying & using in clients
  • Avoid having similar looking characters such as l, 1, I, 0 and 0 in the ShortGuids
  • Decode ShortGuids back to normal Guids for working with them in the backend

Installation

This package is available on NuGet.org, so installation is as easy as running:
dotnet add package Evoke.Components.ShortGuids

Basic usage

using Evoke.Components.ShortGuids;

namespace MyApplication
{
    public class Playground
    {
        public Playground()
        {
            Guid guid = Guid.NewGuid(); 
            // 31bced11-8692-4e79-bf14-7bb56222ce06
            // Thats not very readable and user friendly...

            ShortGuid shortGuidGenerator = new ShortGuid();

            string shortGuid = shortGuidGenerator.Encode(guid);
            // 3E2s2vjdGhUsGjeZpzt4jG
            // Well that's nice to display to the user!
            // Similar characters like O and 0 are removed as well.

            Guid decodedGuid = shortGuidGenerator.Decode(shortGuid);
            // 31bced11-8692-4e79-bf14-7bb56222ce06
            // Now we can work with the actual Guid again.
        }
    }
}

Screenshot

DownloadCounter
GitHub
BuildTarget

Introduction

Often, one needs to use non-sequential IDs in places where users will see them, but the IDs must be as concise and easy to use as possible. ShortGuids solves this problem by translating generated Guids to base57 using lowercase and uppercase letters and digits, and removing similar-looking characters such as l, 1, I, O and 0.

This package is maintained by @ruudschuurmans.
This is a .NET port of the shortuuid PHP library by Pascal de Vink

Goals

  • Provide a .NET Standard 2.0 port of the shortuuid PHP library
  • Encode Guids to user friendly ShortGuids for displaying & using in clients
  • Avoid having similar looking characters such as l, 1, I, 0 and 0 in the ShortGuids
  • Decode ShortGuids back to normal Guids for working with them in the backend

Installation

This package is available on NuGet.org, so installation is as easy as running:
dotnet add package Evoke.Components.ShortGuids

Basic usage

using Evoke.Components.ShortGuids;

namespace MyApplication
{
    public class Playground
    {
        public Playground()
        {
            Guid guid = Guid.NewGuid(); 
            // 31bced11-8692-4e79-bf14-7bb56222ce06
            // Thats not very readable and user friendly...

            ShortGuid shortGuidGenerator = new ShortGuid();

            string shortGuid = shortGuidGenerator.Encode(guid);
            // 3E2s2vjdGhUsGjeZpzt4jG
            // Well that's nice to display to the user!
            // Similar characters like O and 0 are removed as well.

            Guid decodedGuid = shortGuidGenerator.Decode(shortGuid);
            // 31bced11-8692-4e79-bf14-7bb56222ce06
            // Now we can work with the actual Guid again.
        }
    }
}

  • .NETStandard 2.0

    • No dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 164 8/29/2018
1.0.0 136 8/28/2018