[Bro] Function for Decimal to Hex

Mike Dopheide dopheide at gmail.com
Wed Feb 15 11:41:07 PST 2017


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)));

-Dop

On Wed, Feb 15, 2017 at 1:06 PM, John B. Althouse <john.b.althouse at gmail.com
> wrote:

> Sorry, what I want to do is take an integer like:
> 32154
> and convert it to hexidecimal:
> 7D9A
>
> On Wed, Feb 15, 2017 at 1:52 PM, Mike Dopheide <dopheide at gmail.com> wrote:
>
>> Or, if your decimal is already a string, there's always this:
>>
>> https://www.bro.org/sphinx/scripts/base/bif/bro.bif.bro.html
>> #id-bytestring_to_hexstr
>>
>> -Dop
>>
>> On Wed, Feb 15, 2017 at 12:44 PM, Daniel Thayer <dnthayer at illinois.edu>
>> wrote:
>>
>>> You could do something like this ("d" is a count or int value):
>>>
>>> print fmt("%x", d);
>>>
>>>
>>>
>>> On 2/15/17 12:23 PM, John B. Althouse wrote:
>>> >
>>> > Is there a function within Bro that will allow me to turn decimal into
>>> hex?
>>> >
>>> >
>>> _______________________________________________
>>> Bro mailing list
>>> bro at bro-ids.org
>>> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/bro
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ICSI.Berkeley.EDU/pipermail/bro/attachments/20170215/5666096e/attachment.html 


More information about the Bro mailing list