CborBinaryToReadableString converts a CBOR binary to a readable string.
(b []byte)
| 46 | |
| 47 | // CborBinaryToReadableString converts a CBOR binary to a readable string. |
| 48 | func 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 | } |