UUID

UUID object is used to generate random universally unique identifiers.

Version 3.x

Basic Usage

1
2
3
4
5
6
7
8
var uuid = require('utils/v3/uuid');
var response = require('http/v3/response');

response.println(uuid.random());
response.println(uuid.validate('14a3ddce-f86d-4f51-a2e0-6e497b94bbe5'));

response.flush();
response.close();

Definition


Functions


Function Description Returns
random() Returns a random UUID string string
validate(input) Validates whether the provided input is a valid UUID string boolean

Compatibility

Rhino Nashorn V8
βœ… βœ… βœ…


Version 2.x

Basic Usage

1
2
3
4
5
6
7
8
var uuid = require('utils/uuid');
var response = require('net/http/response');

response.println(uuid.random());
response.println(uuid.validate('14a3ddce-f86d-4f51-a2e0-6e497b94bbe5'));

response.flush();
response.close();

Definition

Functions


Function Description Returns
validate(input) Validates whether the provided input is a valid UUID string boolean
random() Returns a random UUID string string

Compatibility

Rhino Nashorn V8
βœ… βœ… ❌
Edit