edgeport - v1.0.3
    Preparing search index...

    Function randomId

    • Returns a random identifier of the form ${prefix}-${randomHex}.

      Parameters

      • prefix: string

        A stable prefix (e.g. a protocol or app name).

      • byteLength: number = 8

        How many random bytes to append as hex; defaults to 8.

      Returns string

      The prefixed random id.

      1.0.3

      import { randomId } from 'edgeport/util';

      const clientId = randomId('edgeport'); // e.g. 'edgeport-3f9a...'