{"name":"@tufjs/canonical-json","version":"2.0.0","description":"OLPC JSON canonicalization","main":"lib/index.js","typings":"lib/index.d.ts","license":"MIT","keywords":["json","canonical","canonicalize","canonicalization","crypto","signature","olpc"],"author":{"name":"bdehamer@github.com"},"repository":{"type":"git","url":"git+https://github.com/theupdateframework/tuf-js.git"},"homepage":"https://github.com/theupdateframework/tuf-js/tree/main/packages/canonical-json#readme","bugs":{"url":"https://github.com/theupdateframework/tuf-js/issues"},"scripts":{"test":"jest"},"engines":{"node":"^16.14.0 || >=18.0.0"},"_id":"@tufjs/canonical-json@2.0.0","gitHead":"95fca28717d763c570ce243c4b1efdac577d0962","_nodeVersion":"16.20.1","_npmVersion":"9.8.1","dist":{"integrity":"sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==","shasum":"a52f61a3d7374833fca945b2549bc30a2dd40d0a","tarball":"http://registry-npm.ywwl.com/@tufjs/canonical-json/download/@tufjs/canonical-json-2.0.0.tgz","fileCount":5,"unpackedSize":5774,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@tufjs%2fcanonical-json@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH2aMraASFVB0+A3hICHk4lqh31QVUb3NdAc3QZXve01AiAJ0tT3b+ptaoYoiUgkKBSjt1jG+WEg6Eeoop6JHCNomQ=="}],"size":2691,"noattachment":false,"key":"/@tufjs/canonical-json/-/@tufjs/canonical-json-2.0.0.tgz"},"_npmUser":{"name":"eugenethehub","email":"ejahngithub@github.com"},"directories":{},"maintainers":[{"name":"eugenethehub","email":"ejahngithub@github.com"},{"name":"bdehamer","email":"brian@dehamer.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/canonical-json_2.0.0_1692295059709_0.8790509572412155"},"_hasShrinkwrap":false,"readme":"# @tufjs/canonical-json\n\nJSON canonicalization compliant with the [OLPC Canonical JSON specification][1].\n\n## Why\n\nIf you're looking for [RFC 8785][2] compliant JSON canonicalization there are\n[any][3] [number][4] [of][5] [libraries][6] [to][7] [choose][8] [from][9].\nYou should only select this library if you know that you specifically need\nsupport for the [OLPC][1]-style of canonicalization.\n\nOne reason you might chose OLPC compliance is for interoperability with\n[The Update Framework][10] which specifically calls out OLPC as the\ncanonicalization standard for computing signatures over TUF metadata.\n\nThe canonicalized strings generated by this library are compatible with those\ngenerated by the Python-based [securesystemslib][11] library and the Go-based\n[go-securesystemslib][12] library.\n\n## Installation\n\n```console\nnpm install @tufjs/canonical-json\n```\n\n## Usage\n\n```javascript\nconst json = require('@tufjs/canonical-json')\n\nconst obj = {\n  bool: true,\n  num: 42,\n  ary: [1, 2, 3],\n  str: \"foo\\\\bar\"\n}\n\nconsole.log(json.canonicalize(obj))\n// output: {\"ary\":[1,2,3],\"bool\":true,\"num\":42,\"str\":\"foo\\\\bar\"}\n```\n\n[1]: https://wiki.laptop.org/go/Canonical_JSON\n[2]: https://www.rfc-editor.org/rfc/rfc8785\n[3]: https://www.npmjs.com/package/@stratumn/canonicaljson\n[4]: https://www.npmjs.com/package/@truestamp/canonify\n[5]: https://www.npmjs.com/package/canonical-json\n[6]: https://www.npmjs.com/package/canonicalize\n[7]: https://www.npmjs.com/package/canonicalize-json\n[8]: https://www.npmjs.com/package/json-canonicalize\n[9]: https://www.npmjs.com/package/another-json\n[10]: https://theupdateframework.github.io/specification/latest/#metaformat\n[11]: https://github.com/secure-systems-lab/securesystemslib\n[12]: https://github.com/secure-systems-lab/go-securesystemslib\n","publish_time":1692295059856,"_cnpm_publish_time":1692295059856,"dist-tags":{"latest":"2.0.0"}}