Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Best Language for the job?

Name: Anonymous 2007-03-11 1:22 ID:V0b/AoE6

The problem is simple.
given a binary string of X(several megabytes)
it needs to be XORed with binary string Y(the same lenght).
The strings are read(converted) from files,and then results written to third file.After which a shell script is
performed on the third file.

The question is:Which language this problem is best coded in? (best=least code size,and the solution must work on Gigabyte+ files)

Name: Anonymous 2007-03-12 0:34 ID:zdZyqDWS

Haskell will be something like;
import qualified Data.ByteString as B
import Data.Bits
import Data.Char

main = do
        x <- B.readFile "file1"
        y <- B.readFile "file2"
        putStr $ map (chr . fromIntegral) $ B.zipWith xor x y


Although I'm not sure if readFile is lazy. If it isn't, this will be a bad thing.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List