@tufjs/canonical-json
OLPC JSON canonicalization
Last updated a year ago by eugenethehub .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install @tufjs/canonical-json 
SYNC missed versions from official npm registry.

@tufjs/canonical-json

JSON canonicalization compliant with the OLPC Canonical JSON specification.

Why

If you're looking for RFC 8785 compliant JSON canonicalization there are any number of libraries to choose from. You should only select this library if you know that you specifically need support for the OLPC-style of canonicalization.

One reason you might chose OLPC compliance is for interoperability with The Update Framework which specifically calls out OLPC as the canonicalization standard for computing signatures over TUF metadata.

The canonicalized strings generated by this library are compatible with those generated by the Python-based securesystemslib library and the Go-based go-securesystemslib library.

Installation

npm install @tufjs/canonical-json

Usage

const json = require('@tufjs/canonical-json')

const obj = {
  bool: true,
  num: 42,
  ary: [1, 2, 3],
  str: "foo\\bar"
}

console.log(json.canonicalize(obj))
// output: {"ary":[1,2,3],"bool":true,"num":42,"str":"foo\\bar"}

Current Tags

  • 2.0.0                                ...           latest (a year ago)

2 Versions

  • 2.0.0                                ...           a year ago
  • 1.0.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |