module CryptBufferConcern::Array
Public Instance Methods
+(other)
click to toggle source
# File lib/crypto-toolbox/crypt_buffer/concerns/array.rb, line 3 def +(other) # make sure the input is a cryptbuffer # Thus we support cryptbuffers and byte arrays CryptBuffer(bytes + CryptBuffer(other).bytes) end
[](*things)
click to toggle source
# File lib/crypto-toolbox/crypt_buffer/concerns/array.rb, line 25 def [](*things) CryptBuffer(bytes[*things]) end
first(n = 1 )
click to toggle source
# File lib/crypto-toolbox/crypt_buffer/concerns/array.rb, line 17 def first(n = 1 ) CryptBuffer(bytes.first(n)) end
last(n = 1)
click to toggle source
# File lib/crypto-toolbox/crypt_buffer/concerns/array.rb, line 21 def last(n = 1) CryptBuffer(bytes.last(n)) end
shift(n = 1)
click to toggle source
# File lib/crypto-toolbox/crypt_buffer/concerns/array.rb, line 9 def shift(n = 1) CryptBuffer(bytes.shift(n)) end
unshift(anything)
click to toggle source
# File lib/crypto-toolbox/crypt_buffer/concerns/array.rb, line 13 def unshift(anything) CryptBuffer(bytes.unshift(anything)) end