Function for Decimal to Hex

Is there a function within Bro that will allow me to turn decimal into hex?

You could do something like this ("d" is a count or int value):

print fmt("%x", d);

Or, if your decimal is already a string, there’s always this:


Sorry, what I want to do is take an integer like:
and convert it to hexidecimal:

Then what Daniel said is your way forward, if you need capital letters, something like this would work:

local num: count = 32154;
print fmt("%s",to_upper(fmt("%x",num)));


The to_upper() function returns a string, so your example can be simplified:

   print to_upper(fmt("%x",num));

Awesome, works! Thank you guys!