Skip to content

Instantly share code, notes, and snippets.

View imanel's full-sized avatar

Bernard Potocki imanel

View GitHub Profile
# gem install fast_xor
module EventMachine
module WebSocket
class MaskedString < String
def read_mask
raise "Too short" if bytesize < 4 # TODO - change
@masking_key = String.new(self[0..3])
end
def full_mask(start, length)