bxor

Matthias Lang <>
Wed Feb 19 13:18:30 CET 2003


Dan Melomedman writes:
 > Hi. I need to bxor other datatypes than integers. What's the
 > recommended way of doing something like this? Thanks.

It depends on what you want to do and how fast you want to do it and
how long you want to spend programming it. 

A simple byte-wise approach to XOR-ing the binary Bin with a constant is:

  list_to_binary( [X bxor 123 || X <- binary_to_list(Bin)] )

Matthias



More information about the erlang-questions mailing list