On Monday, 13 March 2023 at 12:24:15 UTC+1 Van Fury wrote:

Sorry I did not frame my question properly but what I would like to do is to
encode concatenated s1 and s2 into raw binary and then decode the raw binary
back to s1 and s2.


The only problem is knowing where s1 ends / where s2 starts.
So your "encoded raw binary" should be:
16 byte of len(s1) (e.g. in decimal), s1 and s2.
fmt.Print("%016d%s%s", len(s1), s1,s2) should do.
Decoding by reading 16 byte, Atoi'ing, reading s1 and the
rest is s2.

V. 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4ae07871-d312-4657-8acb-bce2cef14985n%40googlegroups.com.

Reply via email to