Results for: "max_by"

See Zlib::GzipReader documentation for a description.

This is a deprecated alias for each_byte.

No documentation available

Returns the total size in bytes of all the messages on the POP server.

This doesn’t yet handle encodings

True if version satisfies this Requirement.

No documentation available

Returns the discarded bytes when Encoding::InvalidByteSequenceError occurs.

ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1")
begin
  ec.convert("abc\xA1\xFFdef")
rescue Encoding::InvalidByteSequenceError
  p $!      #=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "\xFF" on EUC-JP>
  puts $!.error_bytes.dump          #=> "\xA1"
  puts $!.readagain_bytes.dump      #=> "\xFF"
end

Returns the bytes to be read again when Encoding::InvalidByteSequenceError occurs.

Calls the given block once for each byte in the stream.

Generates a String with length number of cryptographically strong pseudo-random bytes.

Example

OpenSSL::Random.random_bytes(12)
#=> "..."

Generates a String with length number of pseudo-random bytes.

Pseudo-random byte sequences generated by ::pseudo_bytes will be unique if they are of sufficient length, but are not necessarily unpredictable.

Example

OpenSSL::Random.pseudo_bytes(12)
#=> "..."

Queries the entropy gathering daemon EGD on socket path given by filename.

Fetches length number of bytes and uses ::add to seed the OpenSSL built-in PRNG.

SecureRandom.random_bytes generates a random binary string.

The argument n specifies the length of the result string.

If n is not specified or is nil, 16 is assumed. It may be larger in future.

The result may contain any byte: “x00” - “xff”.

require 'securerandom'

SecureRandom.random_bytes #=> "\xD8\\\xE0\xF4\r\xB2\xFC*WM\xFF\x83\x18\xF45\xB6"
SecureRandom.random_bytes #=> "m\xDC\xFC/\a\x00Uf\xB2\xB2P\xBD\xFF6S\x97"

If a secure random number generator is not available, NotImplementedError is raised.

No documentation available
No documentation available

Number of bytes read out of the tar entry

Determines whether the given ‘requirement` is satisfied by the given `spec`, in the context of the current `activated` dependency graph.

@param [Object] requirement @param [DependencyGraph] activated the current dependency graph in the

resolution process.

@param [Object] spec @return [Boolean] whether ‘requirement` is satisfied by `spec` in the

context of the current `activated` dependency graph.

(see Gem::Resolver::Molinillo::SpecificationProvider#requirement_satisfied_by?)

returns the indexth byte as an integer.

modifies the indexth byte as integer.

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (*args) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

This should only be used for methods that delegate keywords to another method, and only for backwards compatibility with Ruby versions before 2.7.

This method will probably be removed at some point, as it exists only for backwards compatibility. As it does not exist in Ruby versions before 2.7, check that the module responds to this method before calling it. Also, be aware that if this method is removed, the behavior of the method will change so that it does not pass through keywords.

module Mod
  def foo(meth, *args, &block)
    send(:"do_#{meth}", *args, &block)
  end
  ruby2_keywords(:foo) if respond_to?(:ruby2_keywords, true)
end

Gets the next 8-bit byte (0..255) from ios. Returns nil if called at end of file.

f = File.new("testfile")
f.getbyte   #=> 84
f.getbyte   #=> 104

Reads a byte as with IO#getbyte, but raises an EOFError on end of file.

Pushes back bytes (passed as a parameter) onto ios, such that a subsequent buffered read will return it. Only one byte may be pushed back before a subsequent read operation (that is, you will be able to read only the last of several bytes that have been pushed back). Has no effect with unbuffered reads (such as IO#sysread).

f = File.new("testfile")   #=> #<File:testfile>
b = f.getbyte              #=> 0x38
f.ungetbyte(b)             #=> nil
f.getbyte                  #=> 0x38
Search took: 9ms  ·  Total Results: 670