Reads a one-character string from the stream. Raises an EOFError
at end of file.
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 (Number)
offset: Current byte offset (Number)
header length: Combined length in bytes of the Tag and Length headers. (Number)
length: The overall remaining length of the entire data (Number)
constructed: Whether this value is constructed or not (Boolean)
tag_class: Current tag class (Symbol
)
tag: The current tag (Number)
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
Start streaming using encoding
Clears the GC
profiler data.
Returns whether the form contained multipart/form-data
Generate a TextArea element, as a String.
name
is the name of the textarea. cols
is the number of columns and rows
is the number of rows in the display.
Alternatively, the attributes can be specified as a hash.
The body is provided by the passed-in no-argument block
textarea("name") # = textarea("NAME" => "name", "COLS" => 70, "ROWS" => 10) textarea("name", 40, 5) # = textarea("NAME" => "name", "COLS" => 40, "ROWS" => 5)
URL-decode a string with encoding(optional).
string = CGI::unescape("%27Stop%21%27+said+Fred") # => "'Stop!' said Fred"
Unescape a string that has been HTML-escaped
CGI::unescapeHTML("Usage: foo "bar" <baz>") # => "Usage: foo \"bar\" <baz>"
Undo escaping such as that done by CGI::escapeElement()
print CGI::unescapeElement( CGI::escapeHTML('<BR><A HREF="url"></A>'), "A", "IMG") # "<BR><A HREF="url"></A>" print CGI::unescapeElement( CGI::escapeHTML('<BR><A HREF="url"></A>'), ["A", "IMG"]) # "<BR><A HREF="url"></A>"
Returns an Array of Range
objects which represent the Range: HTTP
header field, or nil
if there is no such header.
returns a charset parameter in Content-Type field. It is downcased for canonicalization.
If charset parameter is not given but a block is given, the block is called and its result is returned. It can be used to guess charset.
If charset parameter and block is not given, nil is returned except text type in HTTP. In that case, “iso-8859-1” is returned as defined by RFC2616 3.7.1.
Parses self
destructively and returns self
containing the rest arguments left unparsed.
This is entirely Mike Stok’s beast
Displays the given statement
on the standard output (or equivalent).
URI.unescape(str)
str
Unescapes the string.
require 'uri' enc_uri = URI.escape("http://example.com/?a=\11\15") p enc_uri # => "http://example.com/?a=%09%0D" p URI.unescape(enc_uri) # => "http://example.com/?a=\t\r"
Is code
an error status?
Is code
an error status?
Unescapes HTTP reserved and unwise characters in str
See the OpenSSL
documentation for EC_GROUP_set_generator()