@evokegroup/guid
v2.0.1
Published
Generates a GUID using cryptographically strong pseudo-random data.
Downloads
263
Keywords
Readme
@evokegroup/guid
guid(format)
Generates a GUID using cryptographically strong pseudo-random data.
Parameters
| Parameter | Type | Default | Description |
| --------- | ---- | ------- | ----------- |
| format | string
| | The GUID format. See Format Characters section. |
Format Characters
| Character | Description | | --------- | ----------- | | B | Wrapped in { } | | N | No hyphens | | P | Wrapped in ( ) | | U | Uppercase |
Usage
const guid = require('@evokegroup/guid');
console.log(guid()); // Expected output similar to: 5dc5411e-116a-4ee7-aaf7-9f88c6cc8e52
console.log(guid('N')); // Expected output similar to: db43d85921eb4a6490a2f8ce0abe9f1f
console.log(guid('BU')); // Expected output similar to: {5F81AB9C-B8EA-4ECC-A799-EDA201B88DF8}