Options
All
  • Public
  • Public/Protected
  • All
Menu

LSEQ-like CRDT helper class, for generating list position identifiers.

🚧 Not strictly an LSEQ:

  • the base grows by multiples of the radix (not of two)
  • uses a consistently skewed distribution, not an alternating boundary (and therefore not as adaptable)
see

LSEQ an Adaptive Structure for Sequences in Distributed Collaborative Editing (https://hal.archives-ouvertes.fr/hal-00921633/document)

see

Logoot: A Scalable Optimistic Replication Algorithm for Collaborative Editing on P2P Networks (https://hal.inria.fr/inria-00432368/document) §4.1. Logoot model provides much of the basic structure and terminology used here.

Hierarchy

  • LseqDef

Index

Properties

Accessors

Methods

Properties

radix

radix: number = 36

Radix for string conversion. Allowed values per Number.parseInt argument

siteLength

siteLength: number = 16

Length of site identifier. Longer strings are right-trimmed. Shorter strings will be padded (but this should only occur in testing – if a site identifiers are frequently shorter than this length, are they unique enough? And if so, make the length shorter).

skew

skew: number = 3

Distribution skew, power of random position in gap.

1 => leftward skew, better for top-to-bottom list.

Accessors

max

  • Above-upper bound position identifier used for generating a new list tail. Do not use this value in a list (its toString method will throw).

    Returns LseqPosId

min

  • Below-lower bound position identifier used for generating a new list head. Do not use this value in a list (its toString method will throw).

    Returns LseqPosId

Methods

compatible

  • compatible(that: LseqDef): boolean
  • Parameters

    Returns boolean

parse

    • id can be '0' (list start), 'Infinity' (list end) or
    • id length must be a natural number from the sequence 1 + 2 + 3 + ...
    • id characters must be valid for the given radix
    • last id part must be >0

    Parameters

    • id: string

      position identifier as string

    Returns LseqPosId

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Static property
  • Static method
  • Inherited property
  • Protected method

Generated using TypeDoc. Delivered by Vercel. @m-ld/m-ld - v0.9.2-edge.3 Source code licensed MIT. Privacy policy