#Method for converting String into Bytes

9 messages · Page 1 of 1 (latest)

upbeat sentinel
#

Is there or could we have a method for converting Strings into Bytes arrays? I can't seem to sort out how to do it when the String is of an undefined or unknown length at compile time.

opaque cobalt
#

Not at my computer, so I might be wrong here. Morgan's cakewalk had something like a double string::from(...) that might've ended in a bytes array (it was a contract address iirc.) Maybe check the source of that contract linked in the guide (not the ASCII one, but the one that prints them)?

dim musk
#

I definitely asked for this in the past. Im looking for the conversation for what th result was.

dim musk
#

I couldn’t find it, sorry.

#

Without host functions you’d need to read the bytes/string out in chunks.

#

Then add them into a new object

#

It wouldn’t be very efficient.

#

If you open an env issue asking for it, I think it’s an easy sell.

upbeat sentinel