Convert Uint64 to Hex String Help

i dont want to convert it to uint64
29 Replies
Temporal Nightmare
Temporal NightmareOP•3y ago
so how do i do it? i hate console I'm a WPF/WinForms guy but i needed a quicky 4900C11D4BC29D44 should be 4944321593800196169 if hex to ulong and i want to convert it back so if i do 4944321593800196169, it needs to be the original value of hex ulong whatever = Console.ReadLine(); off to a good start with a error
ACiDCA7
ACiDCA7•3y ago
hmm is it just me or dont the hex and decimal match anyway
Temporal Nightmare
Temporal NightmareOP•3y ago
it matches, its a uint4
ACiDCA7
ACiDCA7•3y ago
4900C11D4BC29D44 = 5260416696337997124
Temporal Nightmare
Temporal NightmareOP•3y ago
no uint64 im looking at the hex editor and thats the output That I am aware
private static void ShowUInt64ToHexConverter()
{
Console.WriteLine("UInt64 To Hex Converter\r");
Console.Write("> ");

ulong whatever = Console.ReadLine();
// ulong val = Convert.ToString(Console.ReadLine(), "{0:X}");


Console.WriteLine("Output: {0}", );
Console.Read();
}
private static void ShowUInt64ToHexConverter()
{
Console.WriteLine("UInt64 To Hex Converter\r");
Console.Write("> ");

ulong whatever = Console.ReadLine();
// ulong val = Convert.ToString(Console.ReadLine(), "{0:X}");


Console.WriteLine("Output: {0}", );
Console.Read();
}
so this is a damn mess This is why I stick to GUI's as I am not a cli guy But it would be dumb to make a gui for 1 thing
phaseshift
phaseshift•3y ago
gui or not you still need the same conversion
Temporal Nightmare
Temporal NightmareOP•3y ago
Represent Int64 as a Hexadecimal String in C#
Represent Int64 as a Hexadecimal String in C# - To represent Int64 as a Binary string in C#, use the ToString() method and set the base as the ToString() method ...
Temporal Nightmare
Temporal NightmareOP•3y ago
i even followed this and its not working by example of course for me uint64 UInt64 whatever = Console.ReadLine(); I JUST NEED THIS Please help
phaseshift
phaseshift•3y ago
well, readline returns a string, not a number
Temporal Nightmare
Temporal NightmareOP•3y ago
I only get a day to work on personal crap outside of my boring life 😦
phaseshift
phaseshift•3y ago
did yo usee this?
Temporal Nightmare
Temporal NightmareOP•3y ago
yes but i need to convert it hold then sec
phaseshift
phaseshift•3y ago
even to convert normal number string to ulong, you want ulong.Parse
Temporal Nightmare
Temporal NightmareOP•3y ago
ulong.Parse(Console.ReadLine(), System.Globalization.NumberStyles.HexNumber); better? šŸ™‚
phaseshift
phaseshift•3y ago
think for a second... What is HexNumbers for? What kind of number string is coming from the console?!
Temporal Nightmare
Temporal NightmareOP•3y ago
well I want to put in a ulong value and get a hexvalue string back again, this is not something i know, I do art not this I really need this quick and dirty, i dont care, i will pay Im always stuck doing stupid shit and my pea brain isnt working today adhd sucks ok fine
private static void ShowUInt64ToHexConverter()
{
Console.WriteLine("UInt64 To Hex Converter\r");
Console.Write("> ");

string output = Console.ReadLine();
}
private static void ShowUInt64ToHexConverter()
{
Console.WriteLine("UInt64 To Hex Converter\r");
Console.Write("> ");

string output = Console.ReadLine();
}
ok got the -read string from console part now to parse sec
Temporal Nightmare
Temporal NightmareOP•3y ago
Temporal Nightmare
Temporal NightmareOP•3y ago
ok...
private static void ShowUInt64ToHexConverter()
{
Console.WriteLine("UInt64 To Hex Converter\r");
Console.Write("> ");

string output = Console.ReadLine();

var t = ulong.Parse(output, System.Globalization.NumberStyles.HexNumber);
Console.Write(t);
}
private static void ShowUInt64ToHexConverter()
{
Console.WriteLine("UInt64 To Hex Converter\r");
Console.Write("> ");

string output = Console.ReadLine();

var t = ulong.Parse(output, System.Globalization.NumberStyles.HexNumber);
Console.Write(t);
}
What am I missing ? 4944321593800196169 in hex editors its a uint64 which should be "4900C11D4BC29D44" if in 8 byte hex and i have proof it is XD ok then what do i do to fix this? i am not making a app, its to convert if a WEBSITE had a converter, ID USE IT 😐 but im forced to make code ok hold how the hell is 4900C11D4BC29D44 base 10???? im gonna spend 5 goddamn hours to just do 1 line yes! 4900C11D4BC29D44 SHOULD be the output yes aka DEC decimal var t = ulong.Parse(output, System.Globalization.NumberStyles.Integer); ok hold var t = ulong.Parse(output, System.Globalization.NumberStyles.Any); better? im gonna fucking smash my monitor if not because i cant find a good example ok var outputUlong = ulong.Parse(output); there 😦 i feel like a 3 year old could do this yet im a fucking idiot thanks aging!
Temporal Nightmare
Temporal NightmareOP•3y ago
Temporal Nightmare
Temporal NightmareOP•3y ago
ok 1 min
Temporal Nightmare
Temporal NightmareOP•3y ago
Temporal Nightmare
Temporal NightmareOP•3y ago
Finally 😐 all this just to convert a damn ulong you'd thing a website would have a converter
ACiDCA7
ACiDCA7•3y ago
Decimal to Hexadecimal Converter
Decimal to hex number conversion calculator and how to convert.
ACiDCA7
ACiDCA7•3y ago
liek this one ;)
Temporal Nightmare
Temporal NightmareOP•3y ago
FOR FUCK SAKES i did all this for nothing then
ACiDCA7
ACiDCA7•3y ago
also saw my error where i thought the values didnt match.. was in wrong endianess
Temporal Nightmare
Temporal NightmareOP•3y ago
yeah it's Big Endian šŸ™‚ welp, wrote a console app for nothing now XD but gonna archive it if i need it again On a Saturday? yeah i googled for it but couldn't find the right words to put in 😐
ACiDCA7
ACiDCA7•3y ago
tbh after after noticed your short temper i didnt really wanted to help so waited till someone else chaimed in.. sry <3
Temporal Nightmare
Temporal NightmareOP•3y ago
sorry 😦 it wasnt your fault, im just sick of my failures, it's all i do in life I don't even have a job, im on ssi

Did you find this page helpful?