MCPcopy Create free account
hub / github.com/ceramicnetwork/rust-ceramic / carFromString

Function carFromString

sdk/packages/events/src/encoding.ts:47–53  ·  view source on GitHub ↗
(value: string, base: Base = DEFAULT_BASE)

Source from the content-addressed store, hash-verified

45 * @throws Will throw an error if the base encoding is not supported.
46 */
47export function carFromString(value: string, base: Base = DEFAULT_BASE): CAR {
48 const codec = bases[base]
49 if (codec == null) {
50 throw new Error(`Unsupported base: ${base}`)
51 }
52 return carFactory.fromBytes(codec.decode(value))
53}
54
55/**
56 * Encodes a signed event into a CAR format.

Callers 2

getEventCARMethod · 0.90
eventFromStringFunction · 0.85

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected