From 3411f1d20f09cab47b77bf9eb6b66cf135d19d4c Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Tue, 15 Mar 2022 20:29:25 +0100 Subject: [PATCH] fix: remove deprecated multibase and multihash (#674) Signed-off-by: Timo Glastra --- packages/core/package.json | 5 +- .../modules/credentials/CredentialUtils.ts | 4 +- packages/core/src/modules/dids/domain/Key.ts | 10 ++- .../key/__tests__/KeyDidResolver.test.ts | 2 +- .../src/modules/dids/methods/peer/DidPeer.ts | 11 +-- packages/core/src/utils/Hasher.ts | 23 +++++++ packages/core/src/utils/HashlinkEncoder.ts | 17 ++--- packages/core/src/utils/MultiBaseEncoder.ts | 69 ++++++++++++------- packages/core/src/utils/MultiHashEncoder.ts | 56 ++++++++++++--- packages/core/src/utils/VarintEncoder.ts | 20 ++++++ ...coder.test.ts => MultiBaseEncoder.test.ts} | 4 +- ...coder.test.ts => MultiHashEncoder.test.ts} | 15 ++-- packages/core/src/utils/attachment.ts | 2 +- packages/core/src/utils/index.ts | 2 + yarn.lock | 43 +++--------- 15 files changed, 179 insertions(+), 104 deletions(-) create mode 100644 packages/core/src/utils/Hasher.ts create mode 100644 packages/core/src/utils/VarintEncoder.ts rename packages/core/src/utils/__tests__/{MultibaseEncoder.test.ts => MultiBaseEncoder.test.ts} (89%) rename packages/core/src/utils/__tests__/{MultihashEncoder.test.ts => MultiHashEncoder.test.ts} (68%) diff --git a/packages/core/package.json b/packages/core/package.json index da4e667d75..9c6f008abe 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -39,15 +39,13 @@ "lru_map": "^0.4.1", "luxon": "^1.27.0", "make-error": "^1.3.6", - "multibase": "^4.0.4", - "multiformats": "^9.4.14", - "multihashes": "^4.0.2", "object-inspect": "^1.10.3", "query-string": "^7.0.1", "reflect-metadata": "^0.1.13", "rxjs": "^7.1.0", "tsyringe": "^4.5.0", "uuid": "^8.3.2", + "varint": "^6.0.0", "web-did-resolver": "^2.0.8" }, "devDependencies": { @@ -56,6 +54,7 @@ "@types/luxon": "^1.27.0", "@types/object-inspect": "^1.8.0", "@types/uuid": "^8.3.0", + "@types/varint": "^6.0.0", "rimraf": "~3.0.2", "tslog": "^3.2.0", "typescript": "~4.3.0" diff --git a/packages/core/src/modules/credentials/CredentialUtils.ts b/packages/core/src/modules/credentials/CredentialUtils.ts index 2716920d71..0f25db5dc8 100644 --- a/packages/core/src/modules/credentials/CredentialUtils.ts +++ b/packages/core/src/modules/credentials/CredentialUtils.ts @@ -1,10 +1,10 @@ import type { LinkedAttachment } from '../../utils/LinkedAttachment' import type { CredValues, Schema } from 'indy-sdk' -import { hash as sha256 } from '@stablelib/sha256' import BigNumber from 'bn.js' import { AriesFrameworkError } from '../../error/AriesFrameworkError' +import { Hasher } from '../../utils' import { encodeAttachment } from '../../utils/attachment' import { Buffer } from '../../utils/buffer' import { isBoolean, isNumber, isString } from '../../utils/type' @@ -165,7 +165,7 @@ export class CredentialUtils { value = 'None' } - return new BigNumber(sha256(Buffer.from(value as string))).toString() + return new BigNumber(Hasher.hash(Buffer.from(value as string), 'sha2-256')).toString() } private static isInt32(number: number) { diff --git a/packages/core/src/modules/dids/domain/Key.ts b/packages/core/src/modules/dids/domain/Key.ts index 413dd1dff6..20cafc056d 100644 --- a/packages/core/src/modules/dids/domain/Key.ts +++ b/packages/core/src/modules/dids/domain/Key.ts @@ -1,8 +1,6 @@ import type { KeyType } from '../../../crypto' -import { varint } from 'multiformats' - -import { Buffer, BufferEncoder, MultiBaseEncoder } from '../../../utils' +import { Buffer, BufferEncoder, MultiBaseEncoder, VarintEncoder } from '../../../utils' import { getKeyTypeByMultiCodecPrefix, getMultiCodecPrefixByKeytype } from './key-type/multiCodecKey' @@ -27,7 +25,7 @@ export class Key { public static fromFingerprint(fingerprint: string) { const { data } = MultiBaseEncoder.decode(fingerprint) - const [code, byteLength] = varint.decode(data) + const [code, byteLength] = VarintEncoder.decode(data) const publicKey = Buffer.from(data.slice(byteLength)) const keyType = getKeyTypeByMultiCodecPrefix(code) @@ -38,8 +36,8 @@ export class Key { public get prefixedPublicKey() { const multiCodecPrefix = getMultiCodecPrefixByKeytype(this.keyType) - // Create Uint8Array with length of the prefix bytes, then use varint to fill the prefix bytes - const prefixBytes = varint.encodeTo(multiCodecPrefix, new Uint8Array(varint.encodingLength(multiCodecPrefix))) + // Create Buffer with length of the prefix bytes, then use varint to fill the prefix bytes + const prefixBytes = VarintEncoder.encode(multiCodecPrefix) // Combine prefix with public key return Buffer.concat([prefixBytes, this.publicKey]) diff --git a/packages/core/src/modules/dids/methods/key/__tests__/KeyDidResolver.test.ts b/packages/core/src/modules/dids/methods/key/__tests__/KeyDidResolver.test.ts index b9b7509c30..7c12e9f110 100644 --- a/packages/core/src/modules/dids/methods/key/__tests__/KeyDidResolver.test.ts +++ b/packages/core/src/modules/dids/methods/key/__tests__/KeyDidResolver.test.ts @@ -33,7 +33,7 @@ describe('DidResolver', () => { didDocumentMetadata: {}, didResolutionMetadata: { error: 'notFound', - message: `resolver_error: Unable to resolve did 'did:key:asdfkmjY8GnV5i9YTDtPETC2uUAW6ejw3nk5mXF5yci5ab7th': Error: Invalid multibase: asdfkmjY8GnV5i9YTDtPETC2uUAW6ejw3nk5mXF5yci5ab7th`, + message: `resolver_error: Unable to resolve did 'did:key:asdfkmjY8GnV5i9YTDtPETC2uUAW6ejw3nk5mXF5yci5ab7th': Error: No decoder found for multibase prefix 'a'`, }, }) }) diff --git a/packages/core/src/modules/dids/methods/peer/DidPeer.ts b/packages/core/src/modules/dids/methods/peer/DidPeer.ts index 9f25a10223..33a5a8bd78 100644 --- a/packages/core/src/modules/dids/methods/peer/DidPeer.ts +++ b/packages/core/src/modules/dids/methods/peer/DidPeer.ts @@ -1,10 +1,9 @@ import type { DidDocument } from '../../domain' import type { ParsedDid } from '../../types' -import { hash as sha256 } from '@stablelib/sha256' import { instanceToInstance } from 'class-transformer' -import { BufferEncoder, JsonEncoder, MultiBaseEncoder, MultiHashEncoder, Buffer } from '../../../../utils' +import { JsonEncoder, MultiBaseEncoder, MultiHashEncoder } from '../../../../utils' import { Key } from '../../domain/Key' import { getKeyDidMappingByKeyType } from '../../domain/key-type' import { parseDid } from '../../domain/parse' @@ -73,13 +72,7 @@ export class DidPeer { // Remove id from did document as the id should be generated without an id. const didDocumentBuffer = JsonEncoder.toBuffer({ ...didDocument.toJSON(), id: undefined }) - // TODO: we should improve the buffer/multibase/multihash API. - const didIdentifier = BufferEncoder.toUtf8String( - MultiBaseEncoder.encode( - Buffer.from(MultiHashEncoder.encode(sha256(didDocumentBuffer), 'sha2-256')), - 'base58btc' - ) - ) + const didIdentifier = MultiBaseEncoder.encode(MultiHashEncoder.encode(didDocumentBuffer, 'sha2-256'), 'base58btc') const did = `did:peer:1${didIdentifier}` diff --git a/packages/core/src/utils/Hasher.ts b/packages/core/src/utils/Hasher.ts new file mode 100644 index 0000000000..023a69c708 --- /dev/null +++ b/packages/core/src/utils/Hasher.ts @@ -0,0 +1,23 @@ +import { hash as sha256 } from '@stablelib/sha256' + +export type HashName = 'sha2-256' + +type HashingMap = { + [key in HashName]: (data: Uint8Array) => Uint8Array +} + +const hashingMap: HashingMap = { + 'sha2-256': (data) => sha256(data), +} + +export class Hasher { + public static hash(data: Uint8Array, hashName: HashName): Uint8Array { + const hashFn = hashingMap[hashName] + + if (!hashFn) { + throw new Error(`Unsupported hash name '${hashName}'`) + } + + return hashFn(data) + } +} diff --git a/packages/core/src/utils/HashlinkEncoder.ts b/packages/core/src/utils/HashlinkEncoder.ts index 45d28fe821..6791b514f3 100644 --- a/packages/core/src/utils/HashlinkEncoder.ts +++ b/packages/core/src/utils/HashlinkEncoder.ts @@ -1,12 +1,11 @@ +import type { HashName } from './Hasher' import type { BaseName } from './MultiBaseEncoder' import type { Buffer } from './buffer' -import { hash as sha256 } from '@stablelib/sha256' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore ts is giving me headaches because this package has no types import cbor from 'borc' -import { BufferEncoder } from './BufferEncoder' import { MultiBaseEncoder } from './MultiBaseEncoder' import { MultiHashEncoder } from './MultiHashEncoder' @@ -38,7 +37,7 @@ export class HashlinkEncoder { */ public static encode( buffer: Buffer | Uint8Array, - hashAlgorithm: 'sha2-256', + hashAlgorithm: HashName, baseEncoding: BaseName = 'base58btc', metadata?: Metadata ) { @@ -84,15 +83,13 @@ export class HashlinkEncoder { } private static encodeMultiHash( - buffer: Buffer | Uint8Array, - hashName: 'sha2-256', + data: Buffer | Uint8Array, + hashName: HashName, baseEncoding: BaseName = 'base58btc' ): string { - // TODO: Support more hashing algorithms - const hash = sha256(buffer) - const mh = MultiHashEncoder.encode(hash, hashName) + const mh = MultiHashEncoder.encode(data, hashName) const mb = MultiBaseEncoder.encode(mh, baseEncoding) - return BufferEncoder.toUtf8String(mb) + return mb } private static encodeMetadata(metadata: Metadata, baseEncoding: BaseName): string { @@ -110,7 +107,7 @@ export class HashlinkEncoder { const multibaseMetadata = MultiBaseEncoder.encode(cborData, baseEncoding) - return BufferEncoder.toUtf8String(multibaseMetadata) + return multibaseMetadata } private static decodeMetadata(mb: string): Metadata { diff --git a/packages/core/src/utils/MultiBaseEncoder.ts b/packages/core/src/utils/MultiBaseEncoder.ts index 372e6473f8..2a1e19e125 100644 --- a/packages/core/src/utils/MultiBaseEncoder.ts +++ b/packages/core/src/utils/MultiBaseEncoder.ts @@ -1,45 +1,66 @@ -import multibase from 'multibase' +import { decodeFromBase58, encodeToBase58 } from './base58' -export type BaseName = multibase.BaseName +export type BaseName = 'base58btc' + +type EncodingMap = { + [key in BaseName]: (data: Uint8Array) => string +} + +type DecodingMap = { + [key: string]: (data: string) => { data: Uint8Array; baseName: BaseName } +} + +const multibaseEncodingMap: EncodingMap = { + base58btc: (data) => `z${encodeToBase58(data)}`, +} + +const multibaseDecodingMap: DecodingMap = { + z: (data) => ({ data: decodeFromBase58(data.substring(1)), baseName: 'base58btc' }), +} export class MultiBaseEncoder { /** * * Encodes a buffer into a multibase * - * @param {Uint8Array} buffer the buffer that has to be encoded - * @param {multibase.BaseName} baseName the encoding algorithm + * @param buffer the buffer that has to be encoded + * @param baseName the encoding algorithm */ - public static encode(buffer: Uint8Array, baseName: multibase.BaseName = 'base58btc') { - return multibase.encode(baseName, buffer) + public static encode(buffer: Uint8Array, baseName: BaseName) { + const encode = multibaseEncodingMap[baseName] + + if (!encode) { + throw new Error(`Unsupported encoding '${baseName}'`) + } + + return encode(buffer) } /** * * Decodes a multibase into a Uint8Array * - * @param {string} data the multibase that has to be decoded + * @param data the multibase that has to be decoded * - * @returns {Uint8array} data the decoded multibase - * @returns {string} encodingAlgorithm name of the encoding algorithm + * @returns decoded data and the multi base name */ - public static decode(data: string | Uint8Array): { data: Uint8Array; baseName: string } { - if (this.isValid(data)) { - const baseName = multibase.encodingFromData(data).name - return { data: multibase.decode(data), baseName } + public static decode(data: string): { data: Uint8Array; baseName: string } { + const prefix = data[0] + const decode = multibaseDecodingMap[prefix] + + if (!decode) { + throw new Error(`No decoder found for multibase prefix '${prefix}'`) } - throw new Error(`Invalid multibase: ${data}`) + + return decode(data) } - /** - * - * Validates if it is a valid multibase encoded value - * - * @param {Uint8Array} data the multibase that needs to be validated - * - * @returns {boolean} bool whether the multibase value is encoded - */ - public static isValid(data: string | Uint8Array): boolean { - return multibase.isEncoded(data) ? true : false + public static isValid(data: string): boolean { + try { + MultiBaseEncoder.decode(data) + return true + } catch (error) { + return false + } } } diff --git a/packages/core/src/utils/MultiHashEncoder.ts b/packages/core/src/utils/MultiHashEncoder.ts index 8315de74f0..43a333d495 100644 --- a/packages/core/src/utils/MultiHashEncoder.ts +++ b/packages/core/src/utils/MultiHashEncoder.ts @@ -1,4 +1,25 @@ -import * as multihash from 'multihashes' +import type { HashName } from './Hasher' + +import { Hasher } from './Hasher' +import { VarintEncoder } from './VarintEncoder' +import { Buffer } from './buffer' + +type MultiHashNameMap = { + [key in HashName]: number +} + +type MultiHashCodeMap = { + [key: number]: HashName +} + +const multiHashNameMap: MultiHashNameMap = { + 'sha2-256': 0x12, +} + +const multiHashCodeMap: MultiHashCodeMap = Object.entries(multiHashNameMap).reduce( + (map, [hashName, hashCode]) => ({ ...map, [hashCode]: hashName }), + {} +) export class MultiHashEncoder { /** @@ -10,8 +31,14 @@ export class MultiHashEncoder { * * @returns a multihash */ - public static encode(buffer: Uint8Array, hashName: 'sha2-256'): Uint8Array { - return multihash.encode(buffer, hashName) + public static encode(data: Uint8Array, hashName: 'sha2-256'): Buffer { + const hash = Hasher.hash(data, hashName) + const hashCode = multiHashNameMap[hashName] + + const hashPrefix = VarintEncoder.encode(hashCode) + const hashLengthPrefix = VarintEncoder.encode(hash.length) + + return Buffer.concat([hashPrefix, hashLengthPrefix, hash]) } /** @@ -22,12 +49,23 @@ export class MultiHashEncoder { * * @returns object with the data and the hashing algorithm */ - public static decode(data: Uint8Array): { data: Uint8Array; hashName: string } { - if (this.isValid(data)) { - const decodedHash = multihash.decode(data) - return { data: decodedHash.digest, hashName: decodedHash.name } + public static decode(data: Uint8Array): { data: Buffer; hashName: string } { + const [hashPrefix, hashPrefixByteLength] = VarintEncoder.decode(data) + const withoutHashPrefix = data.slice(hashPrefixByteLength) + + const [, lengthPrefixByteLength] = VarintEncoder.decode(withoutHashPrefix) + const withoutLengthPrefix = withoutHashPrefix.slice(lengthPrefixByteLength) + + const hashName = multiHashCodeMap[hashPrefix] + + if (!hashName) { + throw new Error(`Unsupported hash code 0x${hashPrefix.toString(16)}`) + } + + return { + data: Buffer.from(withoutLengthPrefix), + hashName: multiHashCodeMap[hashPrefix], } - throw new Error(`Invalid multihash: ${data}`) } /** @@ -40,7 +78,7 @@ export class MultiHashEncoder { */ public static isValid(data: Uint8Array): boolean { try { - multihash.validate(data) + MultiHashEncoder.decode(data) return true } catch (e) { return false diff --git a/packages/core/src/utils/VarintEncoder.ts b/packages/core/src/utils/VarintEncoder.ts new file mode 100644 index 0000000000..d8a16699da --- /dev/null +++ b/packages/core/src/utils/VarintEncoder.ts @@ -0,0 +1,20 @@ +import { decode, encode, encodingLength } from 'varint' + +import { Buffer } from './buffer' + +export class VarintEncoder { + public static decode(data: Uint8Array | number[] | Buffer) { + const code = decode(data) + return [code, decode.bytes] as const + } + + public static encode(int: number) { + const target = new Buffer(VarintEncoder.encodingLength(int)) + encode(int, target) + return target + } + + public static encodingLength(int: number) { + return encodingLength(int) + } +} diff --git a/packages/core/src/utils/__tests__/MultibaseEncoder.test.ts b/packages/core/src/utils/__tests__/MultiBaseEncoder.test.ts similarity index 89% rename from packages/core/src/utils/__tests__/MultibaseEncoder.test.ts rename to packages/core/src/utils/__tests__/MultiBaseEncoder.test.ts index 49858a48d6..134ad996c7 100644 --- a/packages/core/src/utils/__tests__/MultibaseEncoder.test.ts +++ b/packages/core/src/utils/__tests__/MultiBaseEncoder.test.ts @@ -9,7 +9,7 @@ const invalidMultiBase = 'gKWfinQuRQ3ekD1danFHqvKRg9koFp8vpokUeREEgjSyHwweeKDFax describe('MultiBaseEncoder', () => { describe('encode()', () => { it('Encodes valid multibase', () => { - const multibase = BufferEncoder.toUtf8String(MultiBaseEncoder.encode(validData, 'base58btc')) + const multibase = MultiBaseEncoder.encode(validData, 'base58btc') expect(multibase).toEqual('z2NEpo7TZRRrLZSi2U') }) }) @@ -24,7 +24,7 @@ describe('MultiBaseEncoder', () => { it('Decodes invalid multibase', () => { expect(() => { MultiBaseEncoder.decode(invalidMultiBase) - }).toThrow(/^Invalid multibase: /) + }).toThrow(/^No decoder found for multibase prefix/) }) }) diff --git a/packages/core/src/utils/__tests__/MultihashEncoder.test.ts b/packages/core/src/utils/__tests__/MultiHashEncoder.test.ts similarity index 68% rename from packages/core/src/utils/__tests__/MultihashEncoder.test.ts rename to packages/core/src/utils/__tests__/MultiHashEncoder.test.ts index 38b3eeddb4..af3eb1711f 100644 --- a/packages/core/src/utils/__tests__/MultihashEncoder.test.ts +++ b/packages/core/src/utils/__tests__/MultiHashEncoder.test.ts @@ -1,16 +1,20 @@ -import { BufferEncoder } from '../BufferEncoder' +import { Hasher } from '../Hasher' import { MultiHashEncoder } from '../MultiHashEncoder' import { Buffer } from '../buffer' const validData = Buffer.from('Hello World!') -const validMultiHash = new Uint8Array([18, 12, 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]) +const validMultiHash = new Uint8Array([ + 18, 32, 127, 131, 177, 101, 127, 241, 252, 83, 185, 45, 193, 129, 72, 161, 214, 93, 252, 45, 75, 31, 163, 214, 119, + 40, 74, 221, 210, 0, 18, 109, 144, 105, +]) +const validHash = Hasher.hash(validData, 'sha2-256') const invalidMultiHash = new Uint8Array([99, 12, 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33]) -describe('multihash', () => { +describe('MultiHashEncoder', () => { describe('encode()', () => { it('encodes multihash', () => { const multihash = MultiHashEncoder.encode(validData, 'sha2-256') - expect(multihash).toEqual(new Uint8Array([18, 12, 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33])) + expect(multihash.equals(Buffer.from(validMultiHash))).toBe(true) }) }) @@ -18,7 +22,8 @@ describe('multihash', () => { it('Decodes multihash', () => { const { data, hashName } = MultiHashEncoder.decode(validMultiHash) expect(hashName).toEqual('sha2-256') - expect(BufferEncoder.toUtf8String(data)).toEqual('Hello World!') + + expect(data.equals(Buffer.from(validHash))).toBe(true) }) it('Decodes invalid multihash', () => { diff --git a/packages/core/src/utils/attachment.ts b/packages/core/src/utils/attachment.ts index ce8d4afaf1..ba485219f4 100644 --- a/packages/core/src/utils/attachment.ts +++ b/packages/core/src/utils/attachment.ts @@ -1,5 +1,5 @@ import type { Attachment } from '../decorators/attachment/Attachment' -import type { BaseName } from 'multibase' +import type { BaseName } from './MultiBaseEncoder' import { AriesFrameworkError } from '../error/AriesFrameworkError' diff --git a/packages/core/src/utils/index.ts b/packages/core/src/utils/index.ts index 53c0f65f45..b07c5a44ca 100644 --- a/packages/core/src/utils/index.ts +++ b/packages/core/src/utils/index.ts @@ -6,3 +6,5 @@ export * from './buffer' export * from './MultiHashEncoder' export * from './JWE' export * from './indyProofRequest' +export * from './VarintEncoder' +export * from './Hasher' diff --git a/yarn.lock b/yarn.lock index 6f67fbb564..80894629cc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2413,6 +2413,13 @@ resolved "https://registry.npmjs.org/@types/validator/-/validator-13.7.1.tgz#cdab1b4779f6b1718a08de89d92d2603b71950cb" integrity sha512-I6OUIZ5cYRk5lp14xSOAiXjWrfVoMZVjDuevBYgQDYzZIjsf2CAISpEcXOkFAtpAHbmWIDLcZObejqny/9xq5Q== +"@types/varint@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@types/varint/-/varint-6.0.0.tgz#4ad73c23cbc9b7e44379a7729ace7ed9c8bc9854" + integrity sha512-2jBazyxGl4644tvu3VAez8UA/AtrcEetT9HOeAbqZ/vAcRVL/ZDFQjSS7rkWusU5cyONQVUz+nwwrNZdMva4ow== + dependencies: + "@types/node" "*" + "@types/ws@^7.4.4", "@types/ws@^7.4.6": version "7.4.7" resolved "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" @@ -7419,27 +7426,6 @@ ms@2.1.3, ms@^2.0.0, ms@^2.1.1: resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -multibase@^4.0.1, multibase@^4.0.4: - version "4.0.6" - resolved "https://registry.npmjs.org/multibase/-/multibase-4.0.6.tgz#6e624341483d6123ca1ede956208cb821b440559" - integrity sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ== - dependencies: - "@multiformats/base-x" "^4.0.1" - -multiformats@^9.4.14, multiformats@^9.4.2: - version "9.6.2" - resolved "https://registry.npmjs.org/multiformats/-/multiformats-9.6.2.tgz#3dd8f696171a367fa826b7c432851da850eb115e" - integrity sha512-1dKng7RkBelbEZQQD2zvdzYKgUmtggpWl+GXQBYhnEGGkV6VIYfWgV3VSeyhcUFFEelI5q4D0etCJZ7fbuiamQ== - -multihashes@^4.0.2: - version "4.0.3" - resolved "https://registry.npmjs.org/multihashes/-/multihashes-4.0.3.tgz#426610539cd2551edbf533adeac4c06b3b90fb05" - integrity sha512-0AhMH7Iu95XjDLxIeuCOOE4t9+vQZsACyKZ9Fxw2pcsRmlX4iCn1mby0hS0bb+nQOVpdQYWPpnyusw4da5RPhA== - dependencies: - multibase "^4.0.1" - uint8arrays "^3.0.0" - varint "^5.0.2" - multimatch@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz#932b800963cea7a31a033328fa1e0c3a1874dbe6" @@ -9972,13 +9958,6 @@ uid-number@0.0.6: resolved "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" integrity sha1-DqEOgDXo61uOREnwbaHHMGY7qoE= -uint8arrays@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.0.0.tgz#260869efb8422418b6f04e3fac73a3908175c63b" - integrity sha512-HRCx0q6O9Bfbp+HHSfQQKD7wU70+lydKVt4EghkdOvlK/NlrF90z+eXV34mUd48rNvVJXwkrMSPpCATkct8fJA== - dependencies: - multiformats "^9.4.2" - ultron@1.0.x: version "1.0.2" resolved "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz#ace116ab557cd197386a4e88f4685378c8b2e4fa" @@ -10169,10 +10148,10 @@ validator@^13.5.2: resolved "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857" integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw== -varint@^5.0.2: - version "5.0.2" - resolved "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" - integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== +varint@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/varint/-/varint-6.0.0.tgz#9881eb0ce8feaea6512439d19ddf84bf551661d0" + integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg== vary@^1, vary@~1.1.2: version "1.1.2"