[erlang-questions] How to Update List Elements A Lot

Hugo Wang w@REDACTED
Tue Jul 21 06:00:04 CEST 2015


Hi all,

I'm writing an encrypt/decrypt stuff in Erlang, the input and output are
both lists (or binary). In other words, I need to generate a list of bytes
based on another list of bytes. During the generating there are a lot of
band, bor, bxor, bsl, bsr, etc operations. Every element in the new list
(the output) would be updated many times.

In other language, like C or Python, we can init an output list and then
update its elements inline. In Erlang, what I currently do, would make a
copy of the list every time when an element need to update. This looks not
quite right.

Any comments/ideas on this? I want to use pure Erlang to implement it,
rather than making a C port.

Thanks,
Hugo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150721/147bbbbe/attachment.htm>


More information about the erlang-questions mailing list