[Pharo-users] What is your preferred way for storing ByteArray's as text?

Esteban A. Maringolo emaringolo at gmail.com
Thu Oct 29 12:02:18 EDT 2015

2015-10-29 12:44 GMT-03:00 Sven Van Caekenberghe <sven at stfx.eu>:
> > On 29 Oct 2015, at 16:35, Esteban A. Maringolo <emaringolo at gmail.com> wrote:
> >
> > Hello all,
> >
> > As some already know I'm working in the new GLORP port from VW to Pharo.
> >
> > And as part of minor modifications I'm making to the code, I'd like to know what is your preferred way of storing ByteArrays as text representation/CLOB, etc...
> >
> > Option A) The printString of ByteArray, it is #[23 12 253 ...]
> > Option B) A Base64 encoded version of the ByteArray
> > Option C) Some other encoding
> Does that not dependent, at least in part, on the actual underlying SQL DB ?

Yes it does, but certain backends (like SQLite) doesn't provide BLOB
storage, and that's why I'm talking about CLOB (character instead of
byte based) or text representations for it. I'd like to have a lowest
common denominator to use as a fallback.

> I think HEX and Base64 are make the most sense.

Is Base64 more compact than Hex? (I guess it is, given it's 64vs16 :D)


Esteban A. Maringolo

More information about the Pharo-users mailing list