Comparing version 6.11.1 to 6.11.2
export declare function sha256(payload: string | Uint8Array): Uint8Array; | ||
export declare function keccak(data: Uint8Array): Uint8Array; | ||
export declare function toEthereumAddress(hexPublicKey: string): string; | ||
export declare function ripemd160(data: Uint8Array): Uint8Array; | ||
export declare function concatKDF(secret: Uint8Array, keyLen: number, alg: string, producerInfo?: Uint8Array, consumerInfo?: Uint8Array): Uint8Array; | ||
//# sourceMappingURL=Digest.d.ts.map |
{ | ||
"name": "did-jwt", | ||
"version": "6.11.1", | ||
"version": "6.11.2", | ||
"description": "Library for Signing and Verifying JWTs that use DIDs as issuers and JWEs that use DIDs as recipients", | ||
@@ -72,7 +72,7 @@ "type": "module", | ||
"@types/jwk-to-pem": "^2.0.1", | ||
"@typescript-eslint/eslint-plugin": "5.50.0", | ||
"@typescript-eslint/parser": "5.50.0", | ||
"@typescript-eslint/eslint-plugin": "5.52.0", | ||
"@typescript-eslint/parser": "5.52.0", | ||
"codecov": "3.8.3", | ||
"did-key-creator": "^0.3.2", | ||
"eslint": "8.33.0", | ||
"eslint": "8.34.0", | ||
"eslint-config-prettier": "8.6.0", | ||
@@ -87,3 +87,3 @@ "eslint-plugin-jest": "26.9.0", | ||
"mockdate": "3.0.5", | ||
"prettier": "2.8.3", | ||
"prettier": "2.8.4", | ||
"regenerator-runtime": "0.13.11", | ||
@@ -90,0 +90,0 @@ "semantic-release": "19.0.5", |
import * as u8a from 'uint8arrays' | ||
import { bytesToBase58, base58ToBytes } from '../util' | ||
import { sha256 } from '../Digest' | ||
import { Ripemd160 } from './utils/ripemd160' | ||
import { sha256, ripemd160 } from '../Digest' | ||
@@ -10,3 +9,3 @@ export const publicKeyToAddress = (publicKey: string, otherAddress: string): string => { | ||
const publicKeyBuffer = u8a.fromString(publicKey, 'hex') | ||
const publicKeyHash = new Ripemd160().update(sha256(publicKeyBuffer)).digest() | ||
const publicKeyHash = ripemd160(sha256(publicKeyBuffer)) | ||
const step1 = version + u8a.toString(publicKeyHash, 'hex') | ||
@@ -13,0 +12,0 @@ const step2 = sha256(u8a.fromString(step1, 'hex')) |
import elliptic from 'elliptic' | ||
import { bech32 } from 'bech32' | ||
import * as u8a from 'uint8arrays' | ||
import { sha256 } from '../Digest' | ||
import { Ripemd160 } from './utils/ripemd160' | ||
import { sha256, ripemd160 } from '../Digest' | ||
@@ -13,5 +12,5 @@ const EC = elliptic.ec | ||
const publicKeyBuffer = u8a.fromString(compressedPublicKey, 'hex') | ||
const hash = new Ripemd160().update(sha256(publicKeyBuffer)).digest() | ||
const hash = ripemd160(sha256(publicKeyBuffer)) | ||
const words = bech32.toWords(hash) | ||
return bech32.encode(prefix, words).replace(prefix, '') | ||
} |
import { hash } from '@stablelib/sha256' | ||
import { Ripemd160 } from './blockchains/utils/ripemd160' | ||
import * as u8a from 'uint8arrays' | ||
@@ -19,2 +20,6 @@ import sha3 from 'js-sha3' | ||
export function ripemd160(data: Uint8Array): Uint8Array { | ||
return new Ripemd160().update(data).digest() | ||
} | ||
function writeUint32BE(value: number, array = new Uint8Array(4)): Uint8Array { | ||
@@ -48,3 +53,3 @@ const encoded = u8a.fromString(value.toString(), 'base10') | ||
const roundNumber = 1 | ||
return hash(u8a.concat([writeUint32BE(roundNumber), secret, value])) | ||
return sha256(u8a.concat([writeUint32BE(roundNumber), secret, value])) | ||
} |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1195360
11884