GithubHelp home page GithubHelp logo

pblasucci / ananoid Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 2.0 697 KB

Ananoid provides nano identifiers, an alternative to UUIDs.

Home Page: https://paul.blasuc.ci/ananoid/

License: Mozilla Public License 2.0

C# 9.43% F# 47.23% Visual Basic .NET 5.30% HTML 16.59% CSS 19.34% JavaScript 2.12%
csharp dotnet fsharp identifiers nanoid visual-basic

ananoid's Introduction

Ananoid

Ananoid provides nano identifiers, an alternative to UUIDs. This project was inspired by https://github.com/ai/nanoid.

Overview

A nano identifier, or nanoid, is a randomly generated opaque value, suitable for uniquely identifying database entries, file names, et cetera.

Ananoid (pronounced: "an-an-oyd") is a library for generating such identifiers. It uses cryptographically secure random number generation, and has no dependencies beyond the dotnet 6 base class libraries. It has both a high-level API, and a simpler, more memory-efficient, low-level API.

Recommended Reading

Installation via NuGet

The latest version of this package can be installed from NuGet via the following command:

> dotnet add package pblasucci.ananoid --version 1.1.0

Building from source

Prerequisites:

.NET SDK version 7, or higher (note, .NET 7 is required to build all the projects in this repository. However, consuming the pblasucci.ananoid.dll file only requires .NET 6).

Build steps:

  1. Clone this repo.
  2. From a command prompt, move into the root of th cloned repo.
  3. Restore the necessary tools (eg: > dotnet tool restore).
  4. Compile all project in the solution (eg: > dotnet build).
  5. Run the test suite (eg: > dotnet test).

Preview the docs locally, with "hot reload":

From a command prompt (assuming a basic build and test has worked), run the following:

> dotnet fsdocs watch --port 2023 --input ./docSrc/ \
  --properties Configuration=Release \
  --sourcerepo https://github.com/pblasucci/ananoid

Shout Outs!

Special thanks goes out to TheAngryByrd for doing all the dirty work around the mechanics of HTML layout / theming, which he then -- graciously -- made available under MIT License.

This repository's documentation would look much uglier without his efforts.


Copyright

The library is available under the Mozilla Public License, Version 2.0. For more information see the project's License file.

ananoid's People

Contributors

eliemer avatar pblasucci avatar theangrybyrd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ananoid's Issues

Parsing of empty strings should be more flexible

Currently, parsing an empty string (null, "", " ", et cetera) succeeds, but returns NanoId.Empty. In some scenarios, this is undesirable (ie: sometimes, parsing an empty string should fail).

Suggestion

Add additional functions (to modules) and input parameters (to methods) to support choosing the desired behavior. Specifically:

  • new function in the Alphabet module
  • new function in the NanoId module
  • new overload of Alphabet.ParseNanoId or new method on Alphabet
  • new overload of AlphabetExtensions.TryParseNanoId or new method on AlphabetExtensions

Also: update how-to guides!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.