class HexaPDF::Encryption::RubyARC4

def initialize_state(key)

Performs the key-scheduling algorithm to initialize the state.
def initialize_state(key)
  i = j = 0
  @state = INITIAL_STATE.dup
  key_length = key.length
  while i < 256
    j = (j + @state[i] + key.getbyte(i % key_length)) % 256
    @state[i], @state[j] = @state[j], @state[i]
    i += 1
  end
end