yara icon indicating copy to clipboard operation
yara copied to clipboard

Add math.length()

Open wxsBSD opened this issue 3 years ago • 4 comments

Add a math.length() which will return the length of the sequence of bytes, including any NULL bytes.

Fixes #1778.

wxsBSD avatar Aug 30 '22 15:08 wxsBSD

I find a bit weird that this is included in the math module. Maybe it's time for a string module?

plusvic avatar Sep 06 '22 10:09 plusvic

Sure, I'll do it today.

wxsBSD avatar Sep 06 '22 11:09 wxsBSD

I decided to move the to_int() functions from the math module over to the new string module as it made more sense to me to convert to an integer via string.to_int() instead of math.to_int(). If you want to convert the other way around you still use math.to_string().

wxsBSD avatar Sep 06 '22 14:09 wxsBSD

Having things in a string module is a nice idea, it opens up the possibility of substring functions and other related things.

wxsBSD avatar Sep 06 '22 14:09 wxsBSD

Merged in the next branch.

wxsBSD avatar Dec 15 '22 13:12 wxsBSD