110件ヒット
[1-100件を表示]
(0.022秒)
別のキーワード
モジュール
- Base64 (12)
-
OpenSSL
:: ASN1 (12) - URI (62)
キーワード
- ASN1 (12)
- base64 (12)
- decode64 (12)
-
decode
_ www _ form (12) -
decode
_ www _ form _ component (12) -
encode
_ www _ form (12) -
encode
_ www _ form _ component (12) - unescape (7)
検索結果
先頭5件
-
OpenSSL
:: ASN1 . # decode(der) -> OpenSSL :: ASN1 :: ASN1Data (18119.0) -
DER 表現の文字列を解析し、そこにエンコードされている ASN.1 の値を OpenSSL::ASN1::ASN1Data のサブクラスのインスタンスとして返します。
...、
それを構成する要素も再帰的に解析します。
例:
ruby -e '
require "openssl"
require "pp"
pem = File.read(ARGV[0])
cert = OpenSSL::X509::Certificate.new(pem)
pp OpenSSL::ASN1.decode(cert.to_der)
' mycert.pem
#<OpenSSL::ASN1::Sequence:0x814e9fc
@tag=16,
@t... -
URI
. decode(str) -> String (18119.0) -
URI 文字列をデコードした文字列を返します。
...列を返します。
このメソッドは obsolete です。
代わりに
CGI.unescape,
URI.decode_www_form,
URI.decode_www_form_component
などの使用を検討してください。
例:
require 'uri'
puts URI.unescape('http://images.google.co.jp/images?q=%A5%E2%A5%CA%A5%EA%A5%B6&ie=EUC-... -
URI
. decode _ www _ form _ component(str , enc=Encoding :: UTF _ 8) -> String (6125.0) -
URL-encoded form data の文字列の各コンポーネント をデコードした文字列を返します。
...URL-encoded form data の文字列の各コンポーネント
をデコードした文字列を返します。
通常は URI.decode_www_form を使うほうがよいでしょう。
"+" という文字は空白文字にデコードします。
enc で指定したエンコーディングの文字......されています。
//emlist[][ruby]{
require 'uri'
enc = URI.encode_www_form_component('Ruby リファレンスマニュアル')
# => "Ruby+%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9%E3%83%9E%E3%83%8B%E3%83%A5%E3%82%A2%E3%83%AB"
p URI.decode_www_form_component(enc)
# => "Ruby リフ......ァレンスマニュアル"
//}
@param str デコード対象の文字列
@param enc エンコーディング
@raise ArgumentError str のフォーマットが不正である場合に発生します
@see URI.encode_www_form_component, URI.decode_www_form... -
URI
. decode _ www _ form(str , enc=Encoding :: UTF _ 8) -> [[String , String]] (6119.0) -
文字列から URL-encoded form data をデコードします。
...装されています。
そのため「&」区切りのみに対応していて、「;」区切りには対応していません。
require 'uri'
ary = URI.decode_www_form("a=1&a=2&b=3")
p ary #=> [['a', '1'], ['a', '2'], ['b', '3']]
p ary.assoc('a').last #=> '1'
p ary.as......soc('b').last #=> '3'
p Hash[ary] #=> {"a"=>"2", "b"=>"3"}
@param str デコード対象の文字列
@param enc エンコーディング
@raise ArgumentError str のフォーマットが不正である場合に発生します
@see URI.decode_www_form_component, URI.encode_www_form... -
Base64
. # decode64(str) -> String (6113.0) -
与えられた文字列を Base64 デコードしたデータを返します。
...param str Base64 デコードする文字列を指定します。
require 'base64'
str = 'VGhpcyBpcyBsaW5lIG9uZQpUaGlzIG' +
'lzIGxpbmUgdHdvClRoaXMgaXMgbGlu' +
'ZSB0aHJlZQpBbmQgc28gb24uLi4K'
puts Base64.decode64(str)
# This is line one
# This is line two
# This i... -
URI
. unescape(str) -> String (3019.0) -
URI 文字列をデコードした文字列を返します。
...列を返します。
このメソッドは obsolete です。
代わりに
CGI.unescape,
URI.decode_www_form,
URI.decode_www_form_component
などの使用を検討してください。
例:
require 'uri'
puts URI.unescape('http://images.google.co.jp/images?q=%A5%E2%A5%CA%A5%EA%A5%B6&ie=EUC-... -
OpenSSL
:: ASN1 (42.0) -
ASN.1(Abstract Syntax Notation One) のデータを取り扱うためのモジュールです。
...::ASN1::Primitive のタグ付けの情報を使うことで、
IMPLICIT or EXPLICIT なタグ付けを実現することもできます。
例:
require 'openssl'
# 単純型のデータ
x = OpenSSL::ASN1::UTF8String.new("foobar")
# 構造型のデータ
y = OpenSSL::ASN1::Sequence.new([......1\x00"
# エンコードした文字列をデコード
OpenSSL::ASN1.decode(x.to_der)
# => #<OpenSSL::ASN1::UTF8String:0x000000027cc700 @tag=12, @value="foobar", @tagging=nil, @tag_class=:UNIVERSAL>
OpenSSL::ASN1.decode(y.to_der)
# => #<OpenSSL::ASN1::Sequence:0x000000027c47d0 @tag=16, @va......class=:UNIVERSAL>
OpenSSL::ASN1.decode(z.to_der)
# => #<OpenSSL::ASN1::ASN1Data:0x000000027bc918 @tag=2, @value=[#<OpenSSL::ASN1::Boolean:0x000000027bc968 @tag=1, @value=false, @tagging=nil, @tag_class=:UNIVERSAL>], @tag_class=:APPLICATION>
OpenSSL::ASN1.decode(u.to_der)
# => #<OpenSSL::ASN1... -
URI
. encode _ www _ form(enum , enc=nil) -> String (18.0) -
enum から URL-encoded form data を生成します。
...い。
require 'uri'
URI.encode_www_form([["a", "1"], ["b", "2"], ["c", "x yz"]])
# => "a=1&b=2&c=x+yz"
実際には、each のブロック呼び出しで [key, value] の形のデータを渡すものであれば
何でも渡すことができます(例えば Hash など)。
require 'uri......されています。
@param enum エンコードするデータ列([key, value] という形のデータの列)
@param enc 指定された場合、パーセントエンコーディングする前に、このエンコーディングに変換
@see URI.encode_www_form_component, URI.decode_www_form... -
URI
. encode _ www _ form _ component(str , enc=nil) -> String (12.0) -
文字列を URL-encoded form data の1コンポーネント としてエンコードした文字列を返します。
...は
https://www.w3.org/TR/2013/CR-html5-20130806/forms.html#url-encoded-form-data
にもとづいて実装されています。
//emlist[][ruby]{
require 'uri'
p URI.encode_www_form_component('Ruby リファレンスマニュアル')
# => "Ruby+%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9......%E3%83%9E%E3%83%8B%E3%83%A5%E3%82%A2%E3%83%AB"
//}
@param str エンコードする文字列
@param enc 指定された場合、パーセントエンコーディングする前に、strをこのエンコーディングに変換
@see URI.decode_www_form_component, URI.encode_www_form... -
base64 (12.0)
-
Base64 エンコード / デコードを行うメソッドを定義したモジュールを提供するライブラリです。
...サンプルスクリプトではありません。
=== 使用方法
require "base64"
enc = Base64.encode64('Send reinforcements')
# => "U2VuZCByZWluZm9yY2VtZW50cw==\n"
plain = Base64.decode64(enc)
# => "Send reinforcements"
データを...