216件ヒット
[1-100件を表示]
(0.026秒)
モジュール
- Base64 (72)
- Digest (12)
-
ERB
:: Util (12) - Kconv (12)
-
OpenSSL
:: ASN1 (24) -
WEBrick
:: HTTPStatus (84)
キーワード
-
client
_ error? (12) - decode (12)
- decode64 (12)
-
decode
_ all (12) - encode64 (12)
- error? (12)
- hexencode (12)
- info? (12)
- kconv (12)
-
reason
_ phrase (12) - redirect? (12)
-
server
_ error? (12) -
strict
_ decode64 (12) -
strict
_ encode64 (12) - success? (12)
-
url
_ encode (12) -
urlsafe
_ decode64 (12) -
urlsafe
_ encode64 (12)
検索結果
先頭5件
-
Base64
. # decode64(str) -> String (6101.0) -
与えられた文字列を Base64 デコードしたデータを返します。
...文字列を指定します。
require 'base64'
str = 'VGhpcyBpcyBsaW5lIG9uZQpUaGlzIG' +
'lzIGxpbmUgdHdvClRoaXMgaXMgbGlu' +
'ZSB0aHJlZQpBbmQgc28gb24uLi4K'
puts Base64.decode64(str)
# This is line one
# This is line two
# This is line three
# And so on...... -
Base64
. # encode64(bin) -> String (6101.0) -
与えられたデータを Base64 エンコードした文字列を返します。
...字ごとに改行を追加します。
@param bin Base64 エンコードするデータを指定します。
require 'base64'
Base64.encode64("Now is the time for all good coders\nto learn Ruby")
# => Tm93IGlzIHRoZSB0aW1lIGZvciBhbGwgZ29vZCBjb2RlcnMKdG8gbGVhcm4g
# UnVieQ==... -
Base64
. # strict _ decode64(str) -> String (6101.0) -
与えられた文字列を Base64 デコードしたデータを返します。
与えられた文字列を Base64 デコードしたデータを返します。
このメソッドは 4648 に対応しています。
@param str Base64 デコードする文字列を指定します。
@raise ArgumentError 与えられた引数が Base64 エンコードされたデータとして正しい形式ではない場合に発生します。
例えば、アルファベットでない文字列や CR, LF などが含まれている場合にこの例外は発生します。 -
Base64
. # strict _ encode64(bin) -> String (6101.0) -
与えられたデータを Base64 エンコードした文字列を返します。
与えられたデータを Base64 エンコードした文字列を返します。
このメソッドは 4648 に対応しています。
改行コードを追加することはありません。
@param bin Base64 エンコードするデータを指定します。 -
Base64
. # urlsafe _ decode64(str) -> String (6101.0) -
与えられた文字列を Base64 デコードしたデータを返します。
与えられた文字列を Base64 デコードしたデータを返します。
このメソッドは 4648 の "Base 64 Encoding with URL and Filename Safe Alphabet" に対応しています。
"+" を "-" に "/" を "_" に置き換えます。
@param str Base64 デコードする文字列を指定します。
@raise ArgumentError 与えられた引数が Base64 エンコードされたデータとして正しい形式ではない場合に発生します。
例えば、アルファベットでない文字列や CR, LF などが含まれている場合にこの例... -
Base64
. # urlsafe _ encode64(bin , padding: true) -> String (6101.0) -
与えられたデータを Base64 エンコードした文字列を返します。
...データを指定します。
@param padding false を指定した場合、 = によるパディングが行われなくなります。
//emlist[例][ruby]{
require 'base64'
p Base64.urlsafe_encode64('hoge')
# => "aG9nZQ=="
p Base64.urlsafe_encode64('hoge', padding: false)
# => "aG9nZQ"
//}... -
Digest
. # hexencode(string) -> String (6101.0) -
引数である文字列 string を、16進数に変換した文字列を生成して返します。
...'digest'
p Digest.hexencode("") # => ""
p Digest.hexencode("d") # => "64"
p Digest.hexencode("\1\2") # => "0102"
p Digest.hexencode("\xB0") # => "b0"
p digest = Digest::MD5.digest("ruby") # => "X\xE5=\x13$\xEE\xF6&_\xDB\x97\xB0\x8E\xD9\xAA\xDF"
p Digest.hexencode(digest) # =......8ed9aadf"
p digest = Digest::SHA1.digest("ruby") # => "\x18\xE4\x0E\x14\x01\xEE\xF6~\x1A\xE6\x9E\xFA\xB0\x9A\xFBq\xF8\x7F\xFB\x81"
p Digest.hexencode(digest) # => "18e40e1401eef67e1ae69efab09afb71f87ffb81"
p Digest::SHA1.hexdigest("ruby") # => "18e40e1401eef67e1ae69efab09afb... -
OpenSSL
:: ASN1 . # decode(der) -> OpenSSL :: ASN1 :: ASN1Data (6101.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,
@tag_class=:UNIVERSAL,
@tagging=nil,
@value=
[#<OpenSSL:... -
OpenSSL
:: ASN1 . # decode _ all(der) -> [OpenSSL :: ASN1 :: ASN1Data] (6101.0) -
DER 表現の文字列を解析し、そこにエンコードされている ASN.1 の値を全て OpenSSL::ASN1::ASN1Data のサブクラスのインスタンスの配列として 返します。
...そこにエンコードされている ASN.1 の値を全て
OpenSSL::ASN1::ASN1Data のサブクラスのインスタンスの配列として
返します。
@param der DER形式の文字列
@raise OpenSSL::ASN1::ASN1Error 解析に失敗した場合に発生します
@see OpenSSL::ASN1.#decode...