Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@ndn/naming-convention1

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ndn/naming-convention1

NDNts: Naming Convention rev1

Source
npmnpm
Version
0.0.20210203
Version published
Weekly downloads
22
69.23%
Maintainers
1
Weekly downloads
 
Created
Source

@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);

Keywords

NDN

FAQs

Package last updated on 03 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts