Unique

com.outr.arango.Unique
object Unique

Unique String generator

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Unique.type

Members list

Value members

Concrete methods

def apply(length: Int, characters: String, secure: Boolean): String

Generates a unique String using the characters supplied at the length defined.

Generates a unique String using the characters supplied at the length defined.

Value parameters

characters

the characters for use in the String. Defaults to Unique.defaultCharacters.

length

the length of the resulting String. Defaults to Unique.defaultLength.

secure

true if the randomization should be secure. Defaults to Unique.defaultSecure.

Attributes

Returns

a unique String

def poolSize(length: Int, characters: String): Long

Returns the number of possible values for a specific length and characters.

Returns the number of possible values for a specific length and characters.

Attributes

final def secureRandom(max: Int): Int
final def threadLocalRandom(max: Int): Int

Uses java.util.concurrent.ThreadLocalRandom to generate random numbers.

Uses java.util.concurrent.ThreadLocalRandom to generate random numbers.

Value parameters

max

the maximum value to include

Attributes

Returns

random number between 0 and max

def uuid(secure: Boolean): String

Convenience functionality to generate a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier)

Convenience functionality to generate a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier)

32 characters of unique hexadecimal values with dashes representing 36 total characters

Attributes

Concrete fields

lazy val AllLettersAndNumbers: String
lazy val Hexadecimal: String
lazy val LettersAndNumbers: String
lazy val LettersLower: String
lazy val LettersUpper: String
lazy val Numbers: String
lazy val Readable: String
var defaultCharacters: String

The default characters to use for generating unique values. Defaults to AllLettersAndNumbers.

The default characters to use for generating unique values. Defaults to AllLettersAndNumbers.

Attributes

var defaultLength: Int

The default length to use for generating unique values. Defaults to 32.

The default length to use for generating unique values. Defaults to 32.

Attributes

var defaultSecure: Boolean

True if randomization should be secure. Defaults to false.

True if randomization should be secure. Defaults to false.

Attributes

var random: Int => Int

Random number generator used to generate unique values. Defaults to threadLocalRandom.

Random number generator used to generate unique values. Defaults to threadLocalRandom.

Attributes