String encoding/decoding

Mickael Remond mickael.remond@REDACTED
Wed Apr 16 17:08:47 CEST 2003


"Rudolph van Graan" <rvg@REDACTED> writes:

> I can imagine needing a function that takes 1/2/4 integers [byte values]
> from the list and that builds a single 32bit signed/unsigned int and
> also the reverse. The above example is quite simplistic, my typical
> strings would contain a number of encoded elements, the structure of
> which is known. 
>
> Any ideas or help would be really appreciated!

Did you look at the bit syntax ? This is a pattern matching based
encoding/decoding approach to binary management.

You can have more details here:

http://www.erlang.org/doc/r9b/doc/extensions/bit_syntax.html

I hope this does answer to your question.

-- 
Mickaël Rémond
http://www.erlang-projects.org/




More information about the erlang-questions mailing list