All Projects → aventrix → Jnanoid

aventrix / Jnanoid

Licence: mit
A unique string ID generator for Java.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Jnanoid

Baba Core
Mini-language for creating random text generators.
Stars: ✭ 127 (-13.61%)
Mutual labels:  random, generator
Roguesharp
A .NET Standard class library providing map generation, path-finding, and field-of-view utilities frequently used in roguelikes or 2D tile based games. Inspired by libtcod
Stars: ✭ 316 (+114.97%)
Mutual labels:  random, generator
prestashop-shop-creator
Generate random demo data to test your PrestaShop shop.
Stars: ✭ 22 (-85.03%)
Mutual labels:  generator, random
Randomdatagenerator
This is a configurable generator to create random data like Lorum Ipsum Text, Words, Text Patterns, First/Last Names, MAC-Addresses, IP-Addresses, Guids and DateTime.
Stars: ✭ 45 (-69.39%)
Mutual labels:  random, generator
Keygen Php
A fluent PHP random key generator.
Stars: ✭ 93 (-36.73%)
Mutual labels:  random, generator
Spicy Proton
Generate a random English adjective-noun word pair in Ruby
Stars: ✭ 76 (-48.3%)
Mutual labels:  random, generator
Randomix
🎲 An open source app to choose randomly between numbers, answers, options and so on.
Stars: ✭ 24 (-83.67%)
Mutual labels:  random, generator
Rando Php
RandoPhp is a open source library that implements random generators (Integer, Char, Byte, Sequences, Boolean) and take random sample from arrays
Stars: ✭ 107 (-27.21%)
Mutual labels:  random, generator
Gofakeit
Random fake data generator written in go
Stars: ✭ 2,193 (+1391.84%)
Mutual labels:  random, generator
Github Contribution Stats
Dynamically generated Github Contribution Stats. 📈 📆
Stars: ✭ 139 (-5.44%)
Mutual labels:  generator
Genmon
Generac Generator Monitoring using a Raspberry Pi and WiFi
Stars: ✭ 143 (-2.72%)
Mutual labels:  generator
Umldoclet
Automatically generate PlantUML diagrams in javadoc
Stars: ✭ 138 (-6.12%)
Mutual labels:  generator
Nuxt Generate Cluster
Multi-threaded generator command for nuxt.js
Stars: ✭ 140 (-4.76%)
Mutual labels:  generator
App Privacy Policy Generator
A simple web app to generate a generic privacy policy for your Android/iOS apps
Stars: ✭ 2,278 (+1449.66%)
Mutual labels:  generator
Typegraphql Prisma
Prisma 2 generator to emit TypeGraphQL types and CRUD resolvers from your Prisma 2 schema
Stars: ✭ 137 (-6.8%)
Mutual labels:  generator
Flowchart Fun
Easily generate flowcharts and diagrams from text ⿻
Stars: ✭ 2,311 (+1472.11%)
Mutual labels:  generator
Generator Jekyll Starter Kit
🚀 Jekyll Progressive Web App Generator.
Stars: ✭ 139 (-5.44%)
Mutual labels:  generator
Automatic Gatsbyjs App Landing Page
Automatic GatsbyJS App Landing Page - Automatically generate iOS app landing page using GatsbyJS
Stars: ✭ 137 (-6.8%)
Mutual labels:  generator
Json2builtvalue
Json to Dart built_value classes generator
Stars: ✭ 145 (-1.36%)
Mutual labels:  generator
Pandemonium
Typical random-related functions for JavaScript and TypeScript.
Stars: ✭ 144 (-2.04%)
Mutual labels:  random

JNanoId

Build Status Maven Central

A unique string ID generator for Java.

Secure

JNanoID uses Java’s SecureRandom to generate cryptographically strong random IDs with a proper distribution of characters.

Compact

JNanoID generates compact IDs with just 21 characters. By using a larger alphabet than UUID, JNanoID can generate a greater number of unique IDs, when compared to UUID, with fewer characters (21 versus 36).

URL-Friendly

JNanoID uses URL-friendly characters (A-Za-z0-9_-). Perfect for unique identifiers in web applications.

Customizable

JNanoID is fully customizable. All default options may be overridden. Supply your own Random Number Generator, alphabet, or size.

Tested

JNanoID is thoroughly tested with JUnit.

Latest Release

The most recent release is JNanoId 2.0.0.

Maven

<dependency>
  <groupId>com.aventrix.jnanoid</groupId>
  <artifactId>jnanoid</artifactId>
  <version>2.0.0</version>
</dependency>

Gradle

compile 'com.aventrix.jnanoid:jnanoid:2.0.0'

Usage

JNanoId provides one easy-to-use utility class (NanoIdUtils) with two methods to generate IDs.

Standard IDs - randomNanoId()

The default method creates secure, url-friendly, unique ids. It uses a url-friendly alphabet (A-Za-z0-9_-), a secure random number generator, and generates a unique ID with 21 characters.

String id = NanoIdUtils.randomNanoId(); // "ku-qLNv1wDmIS5_EcT3j7"

Custom IDs - NanoIdUtils.randomNanoId(random, alphabet, size);

An additional method allows you to generate custom IDs by specifying your own random number generator, alphabet, or size.

// Use a faster, but non-secure, random generator
Random random = new Random();

// Use a custom alphabet containing only a, b, and c
char[] alphabet = {'a','b','c'};

// Make IDs 10 characters long
int size = 10;

String id = NanoIdUtils.randomNanoId(random, alphabet, 10); // "babbcaabcb"

Copyright and license

Code copyright 2017 The JNanoID Authors, Aventrix LLC, and Andrey Sitnik. Code released under the MIT License.

Based on the original NanoId for JavaScript by Andrey Sitnik.

Other Programming Languages

Also, a CLI tool is available to generate IDs from the command line.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].