Options
All
  • Public
  • Public/Protected
  • All
Menu

Commit identifier, includes type, genesis CID, commit CID.

Encoded as <multibase-prefix><multicodec-streamid><type><genesis-cid-bytes><commit-cid-bytes>.

String representation is base36-encoding of the bytes above.

Hierarchy

  • CommitID

Implements

Index

Constructors

constructor

  • new CommitID(type: string | number, cid: CID | string, commit?: CID | string | number): CommitID
  • Create a new StreamID.

    example

    new StreamID(, |) new StreamID(, |, |)

    Parameters

    • type: string | number
    • cid: CID | string
    • Default value commit: CID | string | number = null

      CID. Pass '0', 0, or omit the value as shorthand for the genesis commit.

    Returns CommitID

Properties

Protected Readonly _tag

_tag: symbol = TAG

Static fromBytes

fromBytes: fromBytes = fromBytes

Static fromString

fromString: fromString = fromString

Accessors

baseID

bytes

  • get bytes(): Uint8Array

cid

  • get cid(): CID

commit

  • get commit(): CID

type

  • get type(): number

typeName

  • get typeName(): string

Methods

[Symbol.for('nodejs.util.inspect.custom')]

  • [Symbol.for('nodejs.util.inspect.custom')](): string
  • If genesis commit: CommitID(k3y52l7mkcvtg023bt9txegccxe1bah8os3naw5asin3baf3l3t54atn0cuy98yws, 0)

    If commit: CommitID(k3y52l7mkcvtg023bt9txegccxe1bah8os3naw5asin3baf3l3t54atn0cuy98yws, bagjqcgzaday6dzalvmy5ady2m5a5legq5zrbsnlxfc2bfxej532ds7htpova)

    Returns string

[Symbol.toPrimitive]

  • [Symbol.toPrimitive](): string | Uint8Array

atCommit

  • atCommit(commit: CID | string | number): CommitID

equals

toString

  • toString(): string

toUrl

  • toUrl(): string

Static isInstance

  • isInstance(instance: any): instance is CommitID