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

did-jwt

Package Overview
Dependencies
Maintainers
8
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

did-jwt - npm Package Compare versions

Comparing version 5.12.1 to 5.12.2

lib/index.cjs

49

package.json
{
"name": "did-jwt",
"version": "5.12.1",
"version": "5.12.2",
"description": "Library for Signing and Verifying JWTs that use DIDs as issuers and JWEs that use DIDs as recipients",
"type": "module",
"source": "src/index.ts",
"main": "./lib/index.js",
"main": "./lib/index.cjs",
"module": "./lib/index.module.js",

@@ -16,2 +17,8 @@ "unpkg": "./lib/index.umd.js",

],
"exports": {
".": {
"require": "./lib/index.cjs",
"import": "./lib/index.module.js"
}
},
"scripts": {

@@ -21,3 +28,3 @@ "test": "jest",

"build:js": "microbundle --compress=false",
"build:browser": "webpack --config webpack.config.js",
"build:browser": "webpack --config webpack.config.cjs",
"build": "yarn build:js && yarn test && yarn build:browser",

@@ -56,27 +63,27 @@ "build:docs": "echo 'PLEASE UPDATE REFERENCE DOCS MANUALLY'",

"devDependencies": {
"@babel/core": "7.14.6",
"@babel/preset-env": "7.14.7",
"@babel/preset-typescript": "7.14.5",
"@babel/core": "7.16.5",
"@babel/preset-env": "7.16.5",
"@babel/preset-typescript": "7.16.5",
"@semantic-release/changelog": "5.0.1",
"@semantic-release/git": "9.0.0",
"@types/elliptic": "6.4.12",
"@types/jest": "27.0.1",
"@typescript-eslint/eslint-plugin": "4.28.0",
"@typescript-eslint/parser": "4.28.0",
"@semantic-release/git": "9.0.1",
"@types/elliptic": "6.4.14",
"@types/jest": "27.0.3",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"codecov": "3.8.2",
"eslint": "7.29.0",
"eslint": "7.32.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-jest": "24.3.6",
"eslint-plugin-jest": "24.7.0",
"eslint-plugin-prettier": "4.0.0",
"jest": "27.0.5",
"jest": "27.4.5",
"jsontokens": "3.0.0",
"microbundle": "0.13.3",
"microbundle": "0.14.2",
"mockdate": "3.0.5",
"prettier": "2.3.1",
"regenerator-runtime": "0.13.7",
"semantic-release": "17.4.4",
"prettier": "2.5.1",
"regenerator-runtime": "0.13.9",
"semantic-release": "17.4.7",
"tweetnacl": "1.0.3",
"typescript": "4.3.4",
"webpack": "5.40.0",
"webpack-cli": "4.7.2"
"typescript": "4.5.4",
"webpack": "5.65.0",
"webpack-cli": "4.9.1"
},

@@ -83,0 +90,0 @@ "dependencies": {

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

import { ec as EC } from 'elliptic'
import elliptic from 'elliptic'
import { bech32 } from 'bech32'

@@ -7,2 +7,4 @@ import * as u8a from 'uint8arrays'

const EC = elliptic.ec
export const publicKeyToAddress = (publicKey: string, prefix: string): string => {

@@ -9,0 +11,0 @@ const ec = new EC('secp256k1')

import { hash } from '@stablelib/sha256'
import * as u8a from 'uint8arrays'
import { keccak_256 } from 'js-sha3' // eslint-disable-line
import sha3 from 'js-sha3'

@@ -11,3 +11,3 @@ export function sha256(payload: string | Uint8Array): Uint8Array {

export function keccak(data: Uint8Array): Uint8Array {
return new Uint8Array(keccak_256.arrayBuffer(data))
return new Uint8Array(sha3.keccak_256.arrayBuffer(data))
}

@@ -14,0 +14,0 @@

@@ -5,5 +5,5 @@ import { parseKey, leftpad } from '../util'

import { sha256 } from '../Digest'
import elliptic from 'elliptic'
import { ec as EC, ec } from 'elliptic'
const secp256k1: EC = new EC('secp256k1')
const secp256k1 = new elliptic.ec('secp256k1')

@@ -30,6 +30,6 @@ /**

}
const keyPair: ec.KeyPair = secp256k1.keyFromPrivate(privateKeyBytes)
const keyPair: elliptic.ec.KeyPair = secp256k1.keyFromPrivate(privateKeyBytes)
return async (data: string | Uint8Array): Promise<string> => {
const { r, s, recoveryParam }: EC.Signature = keyPair.sign(sha256(data))
const { r, s, recoveryParam }: elliptic.ec.Signature = keyPair.sign(sha256(data))
return toJose(

@@ -36,0 +36,0 @@ {

@@ -1,2 +0,3 @@

import { ec as EC, SignatureInput } from 'elliptic'
import type { SignatureInput } from 'elliptic'
import elliptic from 'elliptic'
import { sha256, toEthereumAddress } from './Digest'

@@ -9,3 +10,3 @@ import { verify } from '@stablelib/ed25519'

const secp256k1 = new EC('secp256k1')
const secp256k1 = new elliptic.ec('secp256k1')

@@ -12,0 +13,0 @@ // converts a JOSE signature to it's components

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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