Socket
Socket
Sign inDemoInstall

cbor2

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cbor2 - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

2

lib/utils.js

@@ -1,1 +0,1 @@

function a(n){const t=n.length/2,r=new Uint8Array(t);for(let e=0;e<t;e++)r[e]=parseInt(n.substr(e<<1,2),16);return r}function u(n){return n.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function g(n){const t=n.reduce((o,i)=>o+i.length,0),r=new Uint8Array(t);let e=0;for(const o of n)r.set(o,e),e+=o.length;return r}function s(n){const t=atob(n);return Uint8Array.from(t,r=>r.codePointAt(0))}const c={"-":"+",_:"/"};function f(n){const t=n.replace(/[_-]/g,r=>c[r]);return s(t.padEnd(Math.ceil(t.length/4)*4,"="))}function l(){const n=new Uint8Array(4),t=new Uint32Array(n.buffer);return!((t[0]=1)&n[0])}function y(n){let t="";for(const r of n){const e=r.codePointAt(0)?.toString(16).padStart(4,"0");t&&(t+=", "),t+=`U+${e}`}return t}export{s as base64ToBytes,f as base64UrlToBytes,a as hexToU8,l as isBigEndian,y as stringToHex,g as u8concat,u as u8toHex};
function c(n){let t=Math.ceil(n.length/2);const r=new Uint8Array(t);t--;for(let e=n.length,o=e-2;e>=0;e=o,o-=2,t--)r[t]=parseInt(n.substring(o,e),16);return r}function u(n){return n.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function g(n){const t=n.reduce((o,i)=>o+i.length,0),r=new Uint8Array(t);let e=0;for(const o of n)r.set(o,e),e+=o.length;return r}function s(n){const t=atob(n);return Uint8Array.from(t,r=>r.codePointAt(0))}const a={"-":"+",_:"/"};function l(n){const t=n.replace(/[_-]/g,r=>a[r]);return s(t.padEnd(Math.ceil(t.length/4)*4,"="))}function f(){const n=new Uint8Array(4),t=new Uint32Array(n.buffer);return!((t[0]=1)&n[0])}function y(n){let t="";for(const r of n){const e=r.codePointAt(0)?.toString(16).padStart(4,"0");t&&(t+=", "),t+=`U+${e}`}return t}export{s as base64ToBytes,l as base64UrlToBytes,c as hexToU8,f as isBigEndian,y as stringToHex,g as u8concat,u as u8toHex};
{
"name": "cbor2",
"version": "1.5.1",
"version": "1.5.2",
"description": "Encode and parse data in the Concise Binary Object Representation (CBOR) data format (RFC8949).",

@@ -52,5 +52,5 @@ "exports": {

"devDependencies": {
"@cto.af/eslint-config": "4.1.5",
"@cto.af/eslint-config": "4.1.6",
"c8": "10.1.2",
"eslint": "9.9.0",
"eslint": "9.9.1",
"eslint-plugin-jsdoc": "50.2.2",

@@ -61,3 +61,3 @@ "eslint-plugin-markdown": "5.1.0",

"typedoc": "0.26.6",
"typescript-eslint": "8.2.0"
"typescript-eslint": "8.3.0"
},

@@ -74,3 +74,3 @@ "overrides": {

},
"packageManager": "pnpm@9.8.0",
"packageManager": "pnpm@9.9.0",
"engines": {

@@ -77,0 +77,0 @@ "node": ">=18"

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