From: bob hope Date: 2012-08-01T07:03:07+09:00 Subject: working with large binary strings? I need to work with multiple large binary strings, and to do XOR operations on their 'rows'. This is all fine, but I am having a slow time to get binary representation in this fashion: a = SecureRandom.random_bytes(250_000).unpack("B*")[0].to_i.to_s(2) I know there must be a quick way to do it, because a = SecureRandom.random_bytes(250_000) is very fast, so I don't know why it would be slow to convert that into a bit string of 1's and 0's that will allow me to manipulate it on a bit by bit basis. Is there a faster way to do this? Generating that string takes about one second, but then getting its binary form as 1's and 0's takes a few minutes. -- Posted via http://www.ruby-forum.com/.