種類
ライブラリ
クラス
-
ARGF
. class (24) - Array (21)
- CSV (24)
-
CSV
:: Row (12) -
CSV
:: Table (12) -
Digest
:: Base (48) - Encoding (324)
-
Encoding
:: Converter (84) -
Gem
:: Dependency (12) -
Gem
:: Indexer (12) -
Gem
:: Version (12) - IO (72)
- Integer (24)
-
JSON
:: State (24) -
Net
:: FTP (24) -
Net
:: IMAP (24) - Pathname (12)
- Regexp (34)
- Ripper (12)
- String (135)
- Symbol (24)
- Thread (10)
- Time (42)
-
URI
:: FTP (24) -
WIN32OLE
_ VARIANT (12) -
Zlib
:: ZStream (12)
モジュール
-
JSON
:: Generator :: GeneratorMethods :: String (12) - Kconv (24)
- NKF (12)
- URI (12)
- Zlib (12)
キーワード
- << (12)
- <=> (48)
-
ANSI
_ X3 _ 4 _ 1968 (12) -
ASCII
_ 8BIT (12) - BINARY (12)
- CP51932 (12)
- CP65001 (12)
- CP932 (12)
- CSWINDOWS31J (12)
- CsWindows31J (12)
- EUCJP (12)
-
EUC
_ JP (12) - EucJP (12)
- IO (12)
- ISASCII (12)
- Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) - NKF (12)
- PCK (12)
- Ruby用語集 (12)
-
SHIFT
_ JIS (12) - SJIS (12)
-
Shift
_ JIS (12) - String (12)
-
US
_ ASCII (12) -
UTF
_ 8 (12) -
WINDOWS
_ 31J (12) -
Windows
_ 31J (12) - aliases (12)
-
append
_ as _ bytes (1) -
ascii
_ compatible? (12) -
ascii
_ only? (24) -
asciicompat
_ encoding (24) - asctime (12)
- b (12)
- binary (12)
- binary= (12)
- binmode (12)
- binread (12)
- binwrite (12)
- build (24)
- chr (24)
- compatible? (12)
- compile (11)
- concat (21)
- ctime (12)
-
data
_ type (12) -
default
_ external (12) - downcase (9)
-
encode
_ www _ form (12) - encoding (24)
-
fixed
_ encoding? (12) -
force
_ encoding (12) - generate (12)
- guess (12)
- hexdigest (24)
- hexdigest! (12)
- inspect (42)
-
internal
_ encoding (24) - list (12)
-
locale
_ charmap (12) - name= (10)
-
name
_ list (12) - new (112)
- pack (21)
- pack テンプレート文字列 (12)
- rdoc (12)
- replacement (12)
- replacement= (12)
- sanitize (12)
-
set
_ encoding (36) - sort (12)
-
to
_ json (12) -
to
_ s (24) -
uid
_ sort (12) - unpack (12)
- upcase! (3)
- リテラル (12)
- 字句構造 (12)
- 正規表現 (12)
検索結果
先頭5件
-
Digest
:: Base # hexdigest -> String (9116.0) -
updateや<<によって追加した文字列に対するハッシュ値を、 ASCIIコードを使って16進数の列を示す文字列にエンコードして返します。
...updateや<<によって追加した文字列に対するハッシュ値を、
ASCIIコードを使って16進数の列を示す文字列にエンコードして返します。
返す文字列は、
MD5では32バイト長、SHA1およびRMD160では40バイト長、SHA256では64バイト長、
SH......バイト長です。
Rubyで書くと以下と同じです。
def hexdigest
digest.unpack("H*")[0]
end
例:
# MD5の場合
require 'digest/md5'
digest = Digest::MD5.new
digest.update("ruby")
p digest.hexdigest # => "58e53d1324eef6265fdb97b08ed9aadf"
@see Digest::Base#digest... -
Digest
:: Base # hexdigest! -> String (9116.0) -
updateや<<によって追加した文字列に対するハッシュ値を、 ASCIIコードを使って16進数の列を示す文字列にエンコードして返します。 Digest::Base#hexdigestと違い、 メソッドの処理後、 オブジェクトの状態を初期状態(newした直後と同様の状態)に戻します。
...、
ASCIIコードを使って16進数の列を示す文字列にエンコードして返します。
Digest::Base#hexdigestと違い、
メソッドの処理後、
オブジェクトの状態を初期状態(newした直後と同様の状態)に戻します。
例:
# MD5の場合
require 'dige......st/md5'
digest = Digest::MD5.new
digest.update("ruby")
p digest.hexdigest! # => "58e53d1324eef6265fdb97b08ed9aadf"
p digest.hexdigest! # => "d41d8cd98f00b204e9800998ecf8427e"
@see Digest::Base#hexdigest、Digest::Base#digest!... -
Digest
:: Base . hexdigest(str) -> String (9116.0) -
与えられた文字列に対するハッシュ値を、ASCIIコードを使って 16進数の列を示す文字列にエンコードして返します。 new(str).hexdigest と等価です。
...与えられた文字列に対するハッシュ値を、ASCIIコードを使って
16進数の列を示す文字列にエンコードして返します。
new(str).hexdigest と等価です。... -
Time
# asctime -> String (9112.0) -
時刻を asctime(3) の形式の文字列に変換します。た だし、末尾の改行文字 "\n" は含まれません。
...を asctime(3) の形式の文字列に変換します。た
だし、末尾の改行文字 "\n" は含まれません。
戻り値の文字エンコーディングは Encoding::US_ASCII です。
//emlist[][ruby]{
p Time.local(2000).asctime # => "Sat Jan 1 00:00:00 2000"
p Time.local(......2000).asctime.encoding # => #<Encoding:US-ASCII>
p Time.local(2000).ctime # => "Sat Jan 1 00:00:00 2000"
//}... -
Time
# ctime -> String (9112.0) -
時刻を asctime(3) の形式の文字列に変換します。た だし、末尾の改行文字 "\n" は含まれません。
...を asctime(3) の形式の文字列に変換します。た
だし、末尾の改行文字 "\n" は含まれません。
戻り値の文字エンコーディングは Encoding::US_ASCII です。
//emlist[][ruby]{
p Time.local(2000).asctime # => "Sat Jan 1 00:00:00 2000"
p Time.local(......2000).asctime.encoding # => #<Encoding:US-ASCII>
p Time.local(2000).ctime # => "Sat Jan 1 00:00:00 2000"
//}... -
IO
. binwrite(path , string , offset=nil) -> Integer (6306.0) -
path で指定されるファイルを開き、string を書き込み、 閉じます。
...path で指定されるファイルを開き、string を書き込み、
閉じます。
ファイルを開くときの mode が "wb:ASCII-8BIT" で、バイナリモードが有効
である点以外は IO.write と同じです。
Kernel.#open と同様 path の先頭が "|" ならば、"|" に......ル名文字列
@param string 書き込む文字列
@param offset 書き込み開始位置
//emlist[例][ruby]{
# 8x8の真っ白なPNG画像データ。
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADklEQVQIW2P4DwUMlDEA98A/wTjP
QBoAAAAASUVORK5CYII='.unpack('m').first
# 期待する先頭......{|c| '%02x' % c }.join(' ')
# => 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52
# binwriteを使用した場合: どの環境でも正しく保存できる。
IO.binwrite('white.binmode.png', png)
puts IO.binread('white.binmode.png', 16).unpack('C*').map {|c| '%02x' % c }.join(' ')
# => 89 50 4e... -
Regexp
. compile(string , option = nil , code = nil) -> Regexp (6306.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。
@param string 正規表現を文字列として与えま......@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE......ングは ASCII-8BIT になります。
それ以外の指定は警告を出力します。
@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。
//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1... -
CSV
# inspect -> String (6216.0) -
ASCII 互換文字列で自身の情報を表したものを返します。
...
ASCII 互換文字列で自身の情報を表したものを返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2")
csv.inspect # => "<#CSV io_type:StringIO encoding:UTF-8 lineno:0 col_sep:\",\" row_sep:\"\\n\" quote_char:\"\\\"\">"
//}... -
CSV
:: Row # inspect -> String (6216.0) -
ASCII 互換であるエンコーディングの文字列で自身の情報を返します。
...ASCII 互換であるエンコーディングの文字列で自身の情報を返します。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2", "header1"], [1, 2, 3])
row.inspect # => "#<CSV::Row \"header1\":1 \"header2\":2 \"header1\":3>"
//}... -
CSV
:: Table # inspect -> String (6216.0) -
モードとサイズを US-ASCII な文字列で返します。
...モードとサイズを US-ASCII な文字列で返します。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.inspect # => "#<CSV::Table mode:col_or_row row_count:2>"
//}...