Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@levischuck/tiny-cbor

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@levischuck/tiny-cbor

Tiny CBOR library

  • 0.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
56K
increased by15.3%
Maintainers
1
Weekly downloads
 
Created
Source

Tiny CBOR

This minimal generic library decodes and encodes most useful CBOR structures into simple JavaScript structures:

  • Maps with keys as strings or numbers with CBORType values as a Map
  • Arrays of CBORType values
  • integers as numbers
  • float32 and float64 as numbers
  • float16 NaN, Infinity, -Infinity
  • strings
  • byte strings as Uint8Array
  • booleans
  • null and undefined
  • tags as CBORTag(tag, value)

Limitations

This implementation does not support:

  • indefinite length maps, arrays, text strings, or byte strings.
  • half precision floating point numbers
  • integers outside the range of [-9007199254740991, 9007199254740991], see Number.MAX_SAFE_INTEGER
  • native output to JSON
  • does not support generic objects, only Maps

This implementation has the following constraints:

  • Map keys may only be strings or numbers
  • Tags are not interpreted

Behavior

Maps that have duplicate keys will throw an error during decoding. Decoding data that is incomplete will throw an error during decoding.

FAQs

Package last updated on 06 Sep 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc