Returns the resulting hash value in a hex-encoded form and resets the digest to the initial state.
If none is given, returns the resulting hash value of the digest in a base64 encoded form, keeping the digest’s state.
If a string
is given, returns the hash value for the given string
in a base64 encoded form, resetting the digest to the initial state before and after the process.
In either case, the return value is properly padded with ‘=’ and contains no line feeds.
Returns the resulting hash value and resets the digest to the initial state.
Creates an array of handlers for the given libs
, can be an instance of Fiddle::Handle
, Fiddle::Importer
, or will create a new instance of Fiddle::Handle
using Fiddle.dlopen
Raises a DLError
if the library cannot be loaded.
See Fiddle.dlopen
Creates a global method from the given C signature
.
The Fiddle::CompositeHandler
instance
Will raise an error if no handlers are open.
Get the next 8bit byte from ‘ssl`. Returns `nil` on EOF
Reads the next “line” from the stream. Lines are separated by eol. If limit is provided the result will not be longer than the given number of bytes.
eol may be a String
or Regexp
.
Unlike IO#gets
the line read will not be assigned to +$_+.
Unlike IO#gets
the separator must be provided if a limit is provided.
Reads one character from the stream. Returns nil if called at end of file.
Pushes character c back onto the stream such that a subsequent buffered character read will return it.
Unlike IO#getc
multiple bytes may be pushed back onto the stream.
Has no effect on unbuffered reads (such as sysread).
Closes the SSLSocket and flushes any unwritten data.
If a block is given, it prints out each of the elements encountered. Block parameters are (in that order):
depth: The recursion depth, plus one with each constructed value being encountered (Integer
)
offset: Current byte offset (Integer
)
header length: Combined length in bytes of the Tag and Length headers. (Integer
)
length: The overall remaining length of the entire data (Integer
)
constructed: Whether this value is constructed or not (Boolean)
tag_class: Current tag class (Symbol
)
tag: The current tag number (Integer
)
der = File.binread('asn1data.der') OpenSSL::ASN1.traverse(der) do | depth, offset, header_len, length, constructed, tag_class, tag| puts "Depth: #{depth} Offset: #{offset} Length: #{length}" puts "Header length: #{header_len} Tag: #{tag} Tag class: #{tag_class} Constructed: #{constructed}" end
Generate a BlockQuote element as a string.
cite
can either be a string, give the URI
for the source of the quoted text, or a hash, giving all attributes of the element, or it can be omitted, in which case the element has no attributes.
The body is provided by the passed-in no-argument block
blockquote("http://www.example.com/quotes/foo.html") { "Foo!" } #=> "<BLOCKQUOTE CITE=\"http://www.example.com/quotes/foo.html\">Foo!</BLOCKQUOTE>
Returns an array of Range
objects that represent the value of field 'Range'
, or nil
if there is no such field; see Range request header:
req = Net::HTTP::Get.new(uri) req['Range'] = 'bytes=0-99,200-299,400-499' req.range # => [0..99, 200..299, 400..499] req.delete('Range') req.range # # => nil
Parses self
destructively in order and returns self
containing the rest arguments left unparsed.
Parses self
destructively in permutation mode and returns self
containing the rest arguments left unparsed.
Substitution of getopts is possible as follows. Also see OptionParser#getopts
.
def getopts(*args) ($OPT = ARGV.getopts(*args)).each do |opt, val| eval "$OPT_#{opt.gsub(/[^A-Za-z0-9_]/, '_')} = val" end rescue OptionParser::ParseError end
Create a new Location
object
Create a new AliasGlobalVariableNode
node
Create a new ArrayPatternNode
node
Create a new BlockArgumentNode
node
Create a new BlockNode
node
Create a new CallOrWriteNode
node