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

[Feature Request] itoh() Integer to hex string function #3105

Closed
galipremsagar opened this issue May 21, 2019 · 2 comments · Fixed by #8450
Closed

[Feature Request] itoh() Integer to hex string function #3105

galipremsagar opened this issue May 21, 2019 · 2 comments · Fixed by #8450
Assignees
Labels
feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. strings strings issues (C++ and Python)

Comments

@galipremsagar
Copy link
Contributor

In custrings, currently there is htoi supported. It will be nice to support stoh where integers are in the form of strings and the output is a hex equivalent of the numbers. Currently the only way to convert a string/number to hex is copying to host memory as we don't have .apply operations with custrings.

Context/Use case: I'm using custrings to convert IPv4 addresses to IPv6. So htoi is really helpful in going from IPv6 to IPv4, but to go from IPv4 to IPv6 we will have to perform hex conversion on host cpu, that's why this feature request.

@davidwendt
Copy link
Contributor

I do not know of any string library that will directly convert a string of an int chars to a string of hex.
I would support creating a itoh() method that converts integers into hex strings. You could use stoi() and itoh() on the same device integer array.

@galipremsagar
Copy link
Contributor Author

Yes, stoi and then itoh would be helpful too.

@mike-wendt mike-wendt transferred this issue from rapidsai/custrings Oct 15, 2019
@mike-wendt mike-wendt added the strings strings issues (C++ and Python) label Oct 15, 2019
@mike-wendt mike-wendt added the feature request New feature or request label Feb 13, 2020
@kkraus14 kkraus14 changed the title [Feature Request] Support Inverse of htoi() -> stoh() [Feature Request] itoh() Integer to hex string function May 29, 2020
@kkraus14 kkraus14 added the libcudf Affects libcudf (C++/CUDA) code. label May 29, 2020
@davidwendt davidwendt self-assigned this Jun 7, 2021
rapids-bot bot pushed a commit that referenced this issue Jun 15, 2021
Closes #3105 

This PR adds the `cudf::strings::integers_to_hex` API to libcudf. Also, adds gtests for testing with all integer types. The PR also includes Cython updates to make the new API available to Python cudf.

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Marlene  (https://github.com/marlenezw)
  - Karthikeyan (https://github.com/karthikeyann)

URL: #8450
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. strings strings issues (C++ and Python)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants