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

Added BytesToLong and LongToBytes #1079

Closed
wants to merge 3 commits into from
Closed

Conversation

clubby789
Copy link

Add a pair of functions to convert an array of bytes to a single long integer, and to do the reverse.

@CLAassistant
Copy link

CLAassistant commented Aug 1, 2020

CLA assistant check
All committers have signed the CLA.

@chengxuncc
Copy link

What you expected are From Base and To Base?

@clubby789
Copy link
Author

@chengxuncc I'm not sure what you mean, can you elaborate?

@clubby789
Copy link
Author

This translates between a decimal integer and a string, if that’s what you mean

@clubby789
Copy link
Author

I believe it's useful to have a dedicated method for this, as opposed to a roundabout recipe with multiple blocks

@mikecat
Copy link
Contributor

mikecat commented Oct 1, 2021

To add, this method using "To Base" and "From Hex" fails when the first byte is in the range 0x01 - 0x0f (only have 1 digit instead of 2).
It should be nice to having a way to handle this automatically.

Example:

Encoding: To Hex, From Base - CyberChef
Decoding (fails): To Base, From Hex - CyberChef

@a3957273
Copy link
Member

Hey! This pull request has gotten rather old and that's our fault. This project stopped being actively maintained for a while and it looks like your pull request has started to gather dust. Would you be able to update your branch to the latest version of CyberChef and we'll give it a review?

@clubby789 clubby789 deleted the branch gchq:master June 12, 2024 14:00
@clubby789 clubby789 closed this Jun 12, 2024
@clubby789 clubby789 deleted the master branch June 12, 2024 14:00
@clubby789
Copy link
Author

Looks like GH permanently closed this while trying to rename my branch 🤔 I'll open a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants