Skip to content

Latest commit

 

History

History

csharp

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Pika

C# implementation for Pika

Installation

dotnet add package Pika

Usage

var pika = new PikaGenerator(new[]
{
    new PikaPrefix
    {
        Prefix = "user",
        Description = "User ID"
    },
    new PikaPrefix
    {
        Prefix = "post",
        Description = "Post ID"
    },
    new PikaPrefix
    {
        Prefix = "sk",
        Description = "Secret Key",
        Secure = true
    }
});

var userId = pika.Generate("user");
    // -> user_MjM4NDAxNDk2MTUzODYyMTQ1

var postId = pika.Generate("post");
    // -> post_MjM4NDAxNDk2MTUzODYyMTQ1

var secretKey = pika.Generate("sk");
    // -> sk_c19FMjdGRjMyMjhGNkE0MDdDRDFFMTZEMEY1Mzk1QUVGRl8yMzg0MDE0OTYxNTgwNTY0NTA