Options
All
  • Public
  • Public/Protected
  • All
Menu

@ndn/naming-convention1

This package is part of NDNts, Named Data Networking libraries for the modern web.

This package implements 2014-version NDN naming conventions as specified in NDN-TR-0022 revision 1. For 2019-version naming conventions, use @ndn/naming-convention2 package.

import { Version, Segment } from "@ndn/naming-convention1";
// We also have ByteOffset, Timestamp, and SequenceNum.

// other imports for examples
import { Name } from "@ndn/packet";
import { strict as assert } from "assert";

// Append name component with marker.
const name = new Name("/A")
  .append(Version, 3)
  .append(Segment, 0);
assert.equal(name.toString(), "/8=A/8=%FD%03/8=%00%00");

// Parse name component as marker.
assert.equal(name.at(-2).as(Version), 3);
assert.equal(name.at(-1).as(Segment), 0);

Index

Variables

Const ByteOffset

ByteOffset: Markered = new Markered(0xFB)

Byte offset marker.

Const Segment

Segment: Markered = new Markered(0x00)

Segment number marker.

Const SequenceNum

SequenceNum: Markered = new Markered(0xFE)

Sequence number marker.

Const Timestamp

Timestamp: Markered = new Markered(0xFC)

Timestamp marker.

Const Version

Version: Markered = new Markered(0xFD)

Version marker.

Legend

  • Namespace
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Class
  • Class with type parameter
  • Enumeration

Generated using TypeDoc