Options
All
  • Public
  • Public/Protected
  • All
Menu

Utitilies for generating IRuntime.replicaIDs.

Hierarchy

  • ReplicaIDs

Index

Properties

CHARS: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"

Characters used for generated replicaIDs: the base64 chars.

DEFAULT_LENGTH: 10 = 10

The default length of a replicaID, in characters.

Methods

  • pseudoRandom(rng: prng, length?: number): string
  • Returns a pseudorandom replicaID made of base64 characters generated from rng (npm package "seedrandom").

    For tests and benchmarks, it is recommended to use such a replicaID with a fixed seed. You can supply the replicaID to CRuntime using its options.debugReplicaID constructor arg.

    Parameters

    • rng: prng
    • Optional length: number

    Returns string

  • random(length?: number): string
  • Returns a cryptographically random replicaID made of base64 characters.

    Parameters

    • Optional length: number

    Returns string

Generated using TypeDoc