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

Implement a string to byte-array conversion method #2138

Closed
iAmMichaelConnor opened this issue Aug 3, 2023 · 0 comments · Fixed by #2298
Closed

Implement a string to byte-array conversion method #2138

iAmMichaelConnor opened this issue Aug 3, 2023 · 0 comments · Fixed by #2298
Assignees
Labels
enhancement New feature or request

Comments

@iAmMichaelConnor
Copy link
Collaborator

iAmMichaelConnor commented Aug 3, 2023

Problem

Currently, strings can't used in many useful ways within the language. The ability to convert a string to a [u8; N] might help.

An example issue we're looking at is this: AztecProtocol/aztec-packages#885

Happy Case

let string = "hello";
let be_bytes = string.to_be_bytes();
let le_bytes = string.to_le_bytes();

(And maybe even the ability to convert back to a string would be nice?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants