110件ヒット
[1-100件を表示]
(0.045秒)
ライブラリ
- base64 (66)
- digest (11)
- erb (11)
- kconv (11)
-
webrick
/ httpstatus (11)
モジュール
- Base64 (66)
- Digest (11)
-
ERB
:: Util (11) - Kconv (11)
-
WEBrick
:: HTTPStatus (11)
キーワード
- decode64 (11)
- encode64 (11)
- hexencode (11)
- kconv (11)
-
reason
_ phrase (11) -
strict
_ decode64 (11) -
strict
_ encode64 (11) -
url
_ encode (11) -
urlsafe
_ decode64 (11) -
urlsafe
_ encode64 (11)
検索結果
先頭5件
-
Digest
. # hexencode(string) -> String (6325.0) -
引数である文字列 string を、16進数に変換した文字列を生成して返します。
...字列 string を、16進数に変換した文字列を生成して返します。
@param string 文字列を指定します。
//emlist[][ruby]{
require 'digest'
p Digest.hexencode("") # => ""
p Digest.hexencode("d") # => "64"
p Digest.hexencode("\1\2") # => "0102"
p Digest.hexencode("\xB.......hexencode(digest) # => "58e53d1324eef6265fdb97b08ed9aadf"
p Digest::MD5.hexdigest("ruby") # => "58e53d1324eef6265fdb97b08ed9aadf"
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(diges... -
Base64
. # decode64(str) -> String (6202.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 (6202.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 (6202.0) -
与えられた文字列を Base64 デコードしたデータを返します。
与えられた文字列を Base64 デコードしたデータを返します。
このメソッドは 4648 に対応しています。
@param str Base64 デコードする文字列を指定します。
@raise ArgumentError 与えられた引数が Base64 エンコードされたデータとして正しい形式ではない場合に発生します。
例えば、アルファベットでない文字列や CR, LF などが含まれている場合にこの例外は発生します。 -
Base64
. # strict _ encode64(bin) -> String (6202.0) -
与えられたデータを Base64 エンコードした文字列を返します。
与えられたデータを Base64 エンコードした文字列を返します。
このメソッドは 4648 に対応しています。
改行コードを追加することはありません。
@param bin Base64 エンコードするデータを指定します。 -
Base64
. # urlsafe _ decode64(str) -> String (6202.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 (6202.0) -
与えられたデータを Base64 エンコードした文字列を返します。
...データを指定します。
@param padding false を指定した場合、 = によるパディングが行われなくなります。
//emlist[例][ruby]{
require 'base64'
p Base64.urlsafe_encode64('hoge')
# => "aG9nZQ=="
p Base64.urlsafe_encode64('hoge', padding: false)
# => "aG9nZQ"
//}... -
ERB
:: Util . # url _ encode(s) -> String (3203.0) -
文字列 s を URLエンコードした文字列を返します。
...を返します(CGI.escapeとほぼ同じです)。
@param s URLエンコードを行う文字列
//emlist[例][ruby]{
require "erb"
include ERB::Util
puts url_encode("Programming Ruby: The Pragmatic Programmer's Guide")
# Programming%20Ruby%3A%20%20The%20Pragmatic%20Programmer%27s%20Guide
//}... -
Kconv
. # kconv(str , out _ code , in _ code = Kconv :: AUTO) -> String (370.0) -
文字列 str のエンコーディングを out_code に変換したものを 返します。in_code も指定されていたら str のエンコーディングが in_code だとして動作します。
...文字列 str のエンコーディングを out_code に変換したものを
返します。in_code も指定されていたら str のエンコーディングが
in_code だとして動作します。
このメソッドはMIME エンコードされた文字列を展開し、
いわゆる半角......カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf を使ってください。
@param str 変換元の文字列
@param out_code 変換後のエンコーディング
@param in_code strのエンコーディング
@see String#kconv... -
WEBrick
:: HTTPStatus . # reason _ phrase(code) -> String (209.0) -
指定された整数が表すステータスコードに対応する reason phrase を表す文字列を返します。
...指定された整数が表すステータスコードに対応する reason phrase
を表す文字列を返します。
@param code HTTP のステータスコードを表す整数か文字列を指定します。
require 'webrick'
p WEBrick::HTTPStatus.reason_phrase(304) #=> "Not Modified"...