How to convert Java Lang. float is encoded as th3ifmw?

I need to parse some basic types of coded Java output (integer, floating point, double precision, floating point) I added this functionality to an existing set of Python scripts, so rewriting it in Java is not actually an option I want to re implement and / or use the python library to decode data (for example, th3ifmw of floating point numbers)

I don't know this code I'm processing the request sent to the Google Web toolkit based on the source here and here – I think it's a string Valueof – but this is not true Does anyone recognize it?

Solution

I think this is encoding a long int, not a float In particular, it may be 0x0000004c7dc814cc, but it may be 0x00000131f7205330

My reason

By looking at the code linked to it, it doesn't look like floating, which is far different from the standard valueof implementation, which will never do like this

On the other hand, the string th3ifmw looks up the world like a Base64 encoded string I can't think of many other common codes that use high letters, low letters and numbers Through the same code, I can only find a reference to Base64... Line 575 of streamwriter, which handles long code instances This is the only part of the link code that can even remotely generate the output you observe

Look at the size of the string... Suppose it is Base64, which lacks a trailing = padding / alignment character, but some implementations of Base64 omit these for brevity Add it back to (th3ifmw =) and decode it to Base64, which will result in the hexadecimal value 0x4c7dc814cc It's only five bytes, which is a little strange But this does mean that it may not be a floating point number (4 bytes) or double (8 bytes)

But this may be suitable for 575 lines of long coding... See base64utils To base 64, which refers to the fact that "leading groups omitting all zeros" If the original length is 0x0000004c7dc814cc, this will interpret the 5-byte value

However, the wording of the document is frustratingly vague (I don't have Java GWT to test right now) "Leading group of all zero bits" may mean that they omit all zero source bytes, but it may also mean that they omit the leading a character in the encoded Base64 character (a represents 60 bits in Base64) If this is the case, the actual Base64 string is ath3ifmw, which is decoded into the long value 0x00000131f7205330

If you can find any of these numbers as input in the content you provide, then this may be what is happening If not... I'm afraid I'll be sad

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>