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

Decode method : public byte[] Decode(string hexdump) #1

Closed
lduchosal opened this issue Mar 28, 2020 · 3 comments
Closed

Decode method : public byte[] Decode(string hexdump) #1

lduchosal opened this issue Mar 28, 2020 · 3 comments

Comments

@lduchosal
Copy link

Hello,

Would you be interested in a method that the inverse encode (Decode) ?

string input = @"
00000000 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
";
var hex = new HexDump();
var bytes = hex.Decode(input);

// bytes = new byte[] { 01, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00 }

Let me now if interested

@drewnoakes
Copy link
Owner

Interesting idea. What's the use case here?

@lduchosal
Copy link
Author

I TestUnit network protocol encoding and decoding.
https://github.com/lduchosal/nbtc/blob/master/src/nbtc/Tests/Network/VersionTest.cs

I use pcap dump to build unit tests.

It can go both ways, encode, decode, encode, string must be the same...
https://github.com/lduchosal/nbtc/blob/master/src/nbtc/Tests/HexdumpTest.cs

I would gladly import the Decode method into your project to have a unified nuget.
https://github.com/lduchosal/nbtc/blob/master/src/nbtc/Tests/HexDump.cs

Let me know.

@lduchosal
Copy link
Author

#3

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

2 participants