exception to wait for reading by EINPROGRESS. see IO.select
.
Parent class for server error (5xx) HTTP
response classes.
A server error response indicates that the server failed to fulfill a request.
References:
Response class for Already Reported (WebDAV)
responses (status code 208).
The Already Reported (WebDAV)
response indicates that the server has received the request, and that the members of a DAV binding have already been enumerated in a preceding part of the (multi-status) response, and are not being included again.
References:
Response class for Permanent Redirect
responses (status code 308).
This and all future requests should be directed to the given URI
.
References:
Response class for Payment Required
responses (status code 402).
Reserved for future use.
References:
Response class for Length Required
responses (status code 411).
The request did not specify the length of its content, which is required by the requested resource.
References:
Response class for Upgrade Required
responses (status code 426).
The client should switch to the protocol given in the Upgrade header field.
References:
Response class for Internal Server Error
responses (status code 500).
An unexpected condition was encountered and no more specific message is suitable.
References:
Raised on redirection, only occurs when redirect
option for HTTP is false
.
Indicates a failure to resolve a name or address.
Given a set of Gem::Dependency
objects as needed
and a way to query the set of available specs via set
, calculates a set of ActivationRequest
objects which indicate all the specs that should be activated to meet the all the requirements.
Raised by Encoding
and String
methods when the source encoding is incompatible with the target encoding.
The base exception for JSON
errors.
This exception is raised if the nesting of parsed data structures is too deep.
This exception is raised if the required unicode support is missing on the system. Usually this means that the iconv library is not installed.
JSON::Coder
holds a parser and generator configuration.
module MyApp JSONC_CODER = JSON::Coder.new( allow_trailing_comma: true ) end MyApp::JSONC_CODER.load(document)
OpenSSL::Digest
allows you to compute message digests (sometimes interchangeably called “hashes”) of arbitrary data that are cryptographically secure, i.e. a Digest
implements a secure one-way function.
One-way functions offer some useful properties. E.g. given two distinct inputs the probability that both yield the same output is highly unlikely. Combined with the fact that every message digest algorithm has a fixed-length output of just a few bytes, digests are often used to create unique identifiers for arbitrary data. A common example is the creation of a unique id for binary documents that are stored in a database.
Another useful characteristic of one-way functions (and thus the name) is that given a digest there is no indication about the original data that produced it, i.e. the only way to identify the original input is to “brute-force” through every possible combination of inputs.
These characteristics make one-way functions also ideal companions for public key signature algorithms: instead of signing an entire document, first a hash of the document is produced with a considerably faster message digest algorithm and only the few bytes of its output need to be signed using the slower public key algorithm. To validate the integrity of a signed document, it suffices to re-compute the hash and verify that it is equal to that in the signature.
You can get a list of all digest algorithms supported on your system by running this command in your terminal:
openssl list -digest-algorithms
Among the OpenSSL
1.1.1 supported message digest algorithms are:
SHA224, SHA256, SHA384, SHA512, SHA512-224 and SHA512-256
SHA3-224, SHA3-256, SHA3-384 and SHA3-512
BLAKE2s256 and BLAKE2b512
Each of these algorithms can be instantiated using the name:
digest = OpenSSL::Digest.new('SHA256')
“Breaking” a message digest algorithm means defying its one-way function characteristics, i.e. producing a collision or finding a way to get to the original data by means that are more efficient than brute-forcing etc. Most of the supported digest algorithms can be considered broken in this sense, even the very popular MD5 and SHA1 algorithms. Should security be your highest concern, then you should probably rely on SHA224, SHA256, SHA384 or SHA512.
data = File.binread('document') sha256 = OpenSSL::Digest.new('SHA256') digest = sha256.digest(data)
data1 = File.binread('file1') data2 = File.binread('file2') data3 = File.binread('file3') sha256 = OpenSSL::Digest.new('SHA256') sha256 << data1 sha256 << data2 sha256 << data3 digest = sha256.digest
Digest
instance data1 = File.binread('file1') sha256 = OpenSSL::Digest.new('SHA256') digest1 = sha256.digest(data1) data2 = File.binread('file2') sha256.reset digest2 = sha256.digest(data2)
Generic error, common for all classes under OpenSSL
module
If an object defines encode_with
, then an instance of Psych::Coder
will be passed to the method when the object is being serialized. The Coder
automatically assumes a Psych::Nodes::Mapping
is being emitted. Other objects like Sequence and Scalar may be emitted if seq=
or scalar=
are called, respectively.
Socket::Option
represents a socket option used by BasicSocket#getsockopt
and BasicSocket#setsockopt
. A socket option contains the socket family
, protocol level
, option name optname
and option value data
.