Blockland Forums > Modification Help

How might one convert a BINARY FILE to a base64 string?

Pages: << < (6/8) > >>

Ipquarx:


--- Quote from: Lugnut1206 on June 16, 2012, 01:00:53 AM ---it is when your goal is to be 100% in torquescript

--- End quote ---
Please stop asking for things that cannot be done to be done.

Well, I shouldn't say it can't be done, it can, but only if badspot makes a binary file reader class or byte reader in the fileobject class.

Lugnut:


--- Quote from: Ipquarx on June 16, 2012, 10:46:53 AM ---Please stop asking for things that cannot be done to be done.

Well, I shouldn't say it can't be done, it can, but only if badspot makes a binary file reader class or byte reader in the fileobject class.

--- End quote ---
i didn't say it could be done
and how could i possibly know what can and cannot be done before i've asked

seriously

zmaster:

Err, why base 64?  Most ASCII characters can be represented perfectly in 8 bit aka a byte.

Lugnut:


--- Quote from: zmaster on June 17, 2012, 02:39:18 PM ---Err, why base 64?  Most ASCII characters can be represented perfectly in 8 bit aka a byte.

--- End quote ---
I don't know, I just figured it would be safer to use alphabetical characters to prevent... mess ups somehow

zmaster:

What kind of file are you trying to convert to a string?

Edit: while reading the file convert 0x00 to a newline?

this might also be helpful
http://ascii-code.com/

carriage return = new line
13(decimal)   0D (hex)

Pages: << < (6/8) > >>

Go to full version