Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 545 Bytes

README.md

File metadata and controls

24 lines (15 loc) · 545 Bytes

Scala CI

Nano ID for Scala

Scala 2 implementation of https://github.com/ai/nanoid

Usage

import com.dallaway.nanoid
val generator = nanoid.generator(naoid.alphabet.`A-Za-z0-9_-`, 21)

import java.security.SecureRandom
val rand1 = new SecureRandom()

val (id, rand2) = generator(rand1)
println(id)
// NanoID(qVWKx3gE4vsndUGesNdTZ)

History

This is a port of JNanoId, modified to return the random generator at each step.