MCPcopy Create free account
hub / github.com/WICG/webpackage / CborBinaryToReadableString

Function CborBinaryToReadableString

go/internal/testhelper/cbor.go:48–57  ·  view source on GitHub ↗

CborBinaryToReadableString converts a CBOR binary to a readable string.

(b []byte)

Source from the content-addressed store, hash-verified

46
47// CborBinaryToReadableString converts a CBOR binary to a readable string.
48func CborBinaryToReadableString(b []byte) (string, error) {
49 r := bytes.NewReader(b)
50
51 var decoded interface{}
52 handle := &codec.CborHandle{}
53 if err := codec.NewDecoder(r, handle).Decode(&decoded); err != nil {
54 return "", err
55 }
56 return readableString(decoded), nil
57}

Calls 2

readableStringFunction · 0.85
NewDecoderMethod · 0.80