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

Checmsum and Length Autofilling #2

Open
gennyble opened this issue Aug 28, 2020 · 2 comments
Open

Checmsum and Length Autofilling #2

gennyble opened this issue Aug 28, 2020 · 2 comments

Comments

@gennyble
Copy link
Owner

A lot of Network protocols require a checksum, but who wants to do that manually. There should/could be an option to specify which byte (or maybe line? Some kind of marker) to insert/replace a checksum of a specific kind.

@gennyble gennyble changed the title Checmsum Filling-out Checmsum and Length Autofilling Jul 8, 2021
@gennyble
Copy link
Owner Author

gennyble commented Jul 8, 2021

Here's the rough plan:

Do a first pass looking for the notation for inserting the checksum/length there. Something like @16:checksum(span) where span is similar to $start(span) <data> $end(span). During the second pass parse the tree you now have and try not to recur to hard?

@gennyble gennyble mentioned this issue Jul 8, 2021
5 tasks
@gennyble gennyble added this to the Version 1 Release milestone Jul 8, 2021
@gennyble
Copy link
Owner Author

gennyble commented Jun 30, 2022

Hello, last-year-me.

I'm still worried that this is some kind of scope creep. Right now I'm of the mind that it's a good idea, still, we want hext to be useful and this'd be useful. I'm not big on the notation I chose for checksum up there, but I like the idea. A span and then a marker to say "put the checksum here and make it N bytes". The number of bytes is probably specified by the algorithm, but I'd very much like it to be explicit/

Maybe a notation of {checksum <algorith> for <span>} would be good. That's the marker and sits where the checksum should go. I like the span notation, but maybe change it to ~start <name> and ~end <name>. They'd have to stand on their own line, like this.

~start header
FD 13 .0100 .1000 {checksum crc32 for header}
~end header

(crc32 is a checksum algorithm, right?)

Not thrilled with the curly braces there, so maybe we'll have to think about that more. Very much like the start/end markers though. It also doesn't say how many bytes it's inserting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant