Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/natsws/src/mod.ts>Nuid

WebSocket NATS
Latest
class Nuid
import { Nuid } from "https://deno.land/x/natsws@v1.28.0/src/mod.ts";

Create and initialize a nuid.

Constructors

new
Nuid()

Properties

buf: Uint8Array
inc: number
inited: boolean
seq: number

Methods

private
fillSeq()

Fills the sequence part of the nuid as base36 from this.seq.

private
init()

Initializes a nuid with a crypto random prefix, and pseudo-random sequence and increment.

private
initSeqAndInc()

Initializes the pseudo randmon sequence number and the increment range.

private
setPre()

Sets the prefix from crypto random bytes. Converts to base36.

next(): string

Returns the next nuid.