Jump to content

Hex strings


JohnOne
 Share

Recommended Posts

I'm working on a wrapper for aria2.

It's a commandline download tool essentially.

When a download starts, it is assigned an id (gid)

But for some reason I cannot fathom, the std output is The first 6 characters of the GID as a hex string

Somehow, it gets from this string gid "4a8667f0eb00f3ae" to this hex string "0ea33e"

And I have no idea how.

Any ideas?

Tried...

string Gid = addDownload();
byte[] ba = Encoding.UTF8.GetBytes(Gid.Substring(0, 6));
Array.Reverse(ba);
var hexString = BitConverter.ToString(ba);
hexString = hexString.Replace("-", "");

Which gives me "373636386134"

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

  • Jos featured and unfeatured this topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...