Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bytes-of.js:76-84: Fix bytes converting for integers.... #118

Open
0pdd opened this issue Nov 6, 2024 · 0 comments
Open

bytes-of.js:76-84: Fix bytes converting for integers.... #118

0pdd opened this issue Nov 6, 2024 · 0 comments
Labels
bug Something isn't working pdd

Comments

@0pdd
Copy link
Collaborator

0pdd commented Nov 6, 2024

The puzzle 3-ff5cb195 from #3 has to be resolved:

* @todo #3:30min Fix bytes converting for integers. There are some differences between how Java
* generate byte array from integers and JS. For example we get the number -18 in XMIR as
* ['0xFF', '0xFF', '0xFF', '0xFF', '0xFF', '0xFF', '0xFF', '0xEE'] byte array. After it cast from
* hex to int it looks like: [255, 255, 255, 255, 255, 255, 255, 238]. But when we do
* {@code bytesOf.long(-18).asBytes()} we get [-1, -1, -1, -1, -1, -1, -1, -72].
* Technically - these arrays are the same because they'll converted to the same integer value -18.
* But at the level of bytes they are different. So we need to adapt the logic of bytes converting
* to Java so generated arrays are the same. For now we use some kind of hack {@link adjustNumber}
* which just allows EO tests to pass but obviously it's wrong.

The puzzle was created by @rultor on 30-Oct-24.

Estimate: 30 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pdd
Projects
None yet
Development

No branches or pull requests

1 participant