Like Enumerable#grep
, but chains operation to be lazy-evaluated.
Like Enumerable#grep_v
, but chains operation to be lazy-evaluated.
Like Enumerable#zip
, but chains operation to be lazy-evaluated. However, if a block is given to zip, values are enumerated immediately.
Like Enumerable#take
, but chains operation to be lazy-evaluated.
Like Enumerable#drop
, but chains operation to be lazy-evaluated.
Return the length of the hash value in bytes.
Return the block length of the digest in bytes.
Return the block length of the digest in bytes.
Digest::SHA256.new.block_length * 8 # => 512 Digest::SHA384.new.block_length * 8 # => 1024 Digest::SHA512.new.block_length * 8 # => 1024
Return the length of the hash value (the digest) in bytes.
Digest::SHA256.new.digest_length * 8 # => 256 Digest::SHA384.new.digest_length * 8 # => 384 Digest::SHA512.new.digest_length * 8 # => 512
For example, digests produced by Digest::SHA256 will always be 32 bytes (256 bits) in size.
Returns the file name of this handle.
Disable a call to dlclose() when this handle is garbage collected.
Enable a call to dlclose() when this handle is garbage collected.
Returns true
if dlclose() will be called when this handle is garbage collected.
See man(3) dlclose() for more info.
Calls wait repeatedly while the given block yields a truthy value.
Sets the key length of the cipher. If the cipher is a fixed length cipher then attempting to set the key length to any value other than the fixed value is an error.
Under normal circumstances you do not need to call this method (and probably shouldn’t).
See EVP_CIPHER_CTX_set_key_length for further information.
Returns the key length in bytes of the Cipher
.
Sets the IV/nonce length of the Cipher
. Normally block ciphers don’t allow changing the IV length, but some make use of IV for ‘nonce’. You may need this for interoperability with other applications.
Returns the expected length in bytes for an IV for this Cipher
.
Returns the output size of the digest, i.e. the length in bytes of the final message digest result.
digest = OpenSSL::Digest.new('SHA1') puts digest.digest_length # => 20
Returns the block length of the digest algorithm, i.e. the length in bytes of an individual block. Most modern algorithms partition a message to be digested into a sequence of fix-sized blocks that are processed consecutively.
digest = OpenSSL::Digest.new('SHA1') puts digest.block_length # => 64
Set
the defaults for this engine with the given flag.
These flags are used to control combinations of algorithm methods.
flag can be one of the following, other flags are available depending on your OS.
0xFFFF
0x0000
See also <openssl/engine.h>
Returns the raw error code occurred at name resolution.
Builds a methods for level meth
.
Delete a registry value named name. We can not delete the ‘default’ value.