Git Product home page Git Product logo

ulid-c's Introduction

ULID Library (C99)

This is a library for generating and handling Universally Unique Lexicographically Sortable Identifiers (ULIDs). On modern hardware running Linux, it can generate 68 million ULIDs per second (50 cycles per ULID). Supported operating systems: POSIX and Win32.

This repository also includes a ulidgen command line utility for generating, validating, and inspecting ULIDs.

Documentation

The complete API documentation is found in ulid.h. Here's summary of the available functions:

int  ulid_generator_init(struct ulid_generator *, int flags);
void ulid_generate(struct ulid_generator *, char[27]);
void ulid_encode(char[27], const unsigned char[16]);
int  ulid_decode(unsigned char[16], const char *);

Here are the command line switches for ulidgen:

usage: ulidgen -G [-prs] [-n N]
       ulidgen -C [-iq] <ULIDs...>
       ulidgen -T [-i] <ULIDs...>
       ulidgen -h
  -G      Generate ULIDs
  -C      Check/validate ULIDs
  -T      Print timestamp from ULIDs
  -h      Display this help message
  -i      (-C|-T) Read ULIDs on standard input
  -n N    (-G) Number of ULIDs to generate [1]
  -p      (-G) Only use 79 random bits to avoid overflow
  -q      (-C) Don't print invalid ULIDs
  -r      (-G) Non-monotonic ULIDs within timestamp
  -s      (-G) Require secure initialization

ulid-c's People

Contributors

evillique avatar skeeto avatar

Watchers

 avatar

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.