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.
Like Enumerable#uniq
, 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.
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.
Performs a Miller-Rabin probabilistic primality test for bn
.
Deprecated in version 3.0. Use prime?
instead.
checks
and trial_div
parameters no longer have any effect.
Sets the authentication tag to verify the integrity of the ciphertext. This can be called only when the cipher supports AE. The tag must be set after calling Cipher#decrypt
, Cipher#key=
and Cipher#iv=
, but before calling Cipher#final
. After all decryption is performed, the tag is verified automatically in the call to Cipher#final
.
For OCB mode, the tag length must be supplied with auth_tag_len=
beforehand.
Gets the authentication tag generated by Authenticated Encryption Cipher
modes (GCM for example). This tag may be stored along with the ciphertext, then set on the decryption cipher to authenticate the contents of the ciphertext against changes. If the optional integer parameter tag_len is given, the returned tag will be tag_len bytes long. If the parameter is omitted, the default length of 16 bytes or the length previously set by auth_tag_len=
will be used. For maximum security, the longest possible should be chosen.
The tag may only be retrieved after calling Cipher#final
.
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
Parses the configuration data read from io and returns the whole content as a Hash
.
Called with encoding
when the YAML
stream starts. This method is called once per stream. A stream may contain multiple documents.
See the constants in Psych::Parser
for the possible values of encoding
.