Skip to content

decodeCborToStringifiedBlob

decodeCborToStringifiedBlob(cborBlob): Promise<string>

Decodes a CBOR-encoded blob from a base64 string back to a stringified blob.

This function takes a base64-encoded string representing a CBOR blob, decodes it to a buffer, and then decodes the buffer to retrieve the original stringified blob.

Parameters

cborBlob: string

A base64-encoded string representing the CBOR blob to decode.

Returns

Promise<string>

A promise that resolves to the original stringified blob.

Throws

If decoding fails due to invalid CBOR format or other issues.

Example

const stringifiedBlob = await decodeCborToStringifiedBlob('base64EncodedCborBlob');
// stringifiedBlob will contain the original stringified blob that was encoded.

Source

registries/src/Registries.ts:345