- Add GETTING_STARTED.md with quick start guide and development modes - Add INSTALL.sh automated installation script - Add INSTALLATION_CHECKLIST.md, INSTALLATION_SUCCESS.md, and INSTALLATION_SUMMARY.md - Add QUICK_REFERENCE.md for common commands - Add SETUP_GUIDE.md with detailed setup instructions - Update README.md with improved project overview - Add did-wallet app dependencies and node_modules
14 lines
453 B
JavaScript
14 lines
453 B
JavaScript
// Example of multicodec implementation for JSON (UTF-8-encoded)
|
|
// Codec implementations should conform to the BlockCodec interface which implements both BlockEncoder and BlockDecoder
|
|
|
|
/**
|
|
* @template T
|
|
* @type {BlockCodec<0x0200, T>}
|
|
*/
|
|
export const { name, code, encode, decode } = {
|
|
name: 'json',
|
|
code: 0x0200,
|
|
encode: json => new TextEncoder().encode(JSON.stringify(json)),
|
|
decode: bytes => JSON.parse(new TextDecoder().decode(bytes))
|
|
}
|