Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotated hex callback #237

Open
1 task done
davaya opened this issue May 30, 2024 · 0 comments
Open
1 task done

Annotated hex callback #237

davaya opened this issue May 30, 2024 · 0 comments

Comments

@davaya
Copy link

davaya commented May 30, 2024

Things to check first

  • I have searched the existing issues and didn't find my feature already requested there

Feature description

Please add the ability to register a visitor callback for each invocation and return of the parser or serializer.

Use case

This would allow the callback function to record the type, its stack depth, and its position in the byte stream, enabling generation of the "Annotated hex" view of a CBOR blob:

Hex:
82A1011901F4C077313938352D30342D31325432333A32303A35302E35325A

Annotated Hex:

82                                      # array(2)
   A1                                   # map(1)
      01                                # unsigned(1)
      19 01F4                           # unsigned(500)
   C0                                   # tag(0)
      77                                # text(23)
         313938352D30342D31325432333A32303A35302E35325A # "1985-04-12T23:20:50.52Z"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant