1.3.2 • Published 6 years ago

uuidgenv4 v1.3.2

Weekly downloads
1
License
WTFPL
Repository
gitlab
Last release
6 years ago

uuidgenv4

Generates UUIDv4 (122 bit random) instances.

Usage:

import { UUID, UUIDsync, UUIDtoString, StringToUUID } from 'uuidgenv4'

UUID().then(uuid => {
	// do stuff like db keys and so on
})

UUID(Buffer.alloc(16), false).then(buf => {
	// it's a 16 byteLength Uint8Array instance. write it to disk or something
})

let b = Buffer.alloc(36)
b.write('IAmYourFather', 0, 20, 'ascii')

UUID(b, false, 20).then(buf => {
	// also a 16 byteLength Uint8Array instance. Shares memory with b.
})

let key = UUIDsync()
console.log(key)
// 8-4-4-4-12
console.log(StringToUUID(key))
// Uint8Array [...]
1.3.2

6 years ago

1.3.0

6 years ago

1.2.0

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago