36件ヒット
[1-36件を表示]
(0.049秒)
ライブラリ
- ビルトイン (7)
- securerandom (11)
クラス
- Random (7)
キーワード
-
NEWS for Ruby 2
. 5 . 0 (7) - SecureRandom (11)
-
ruby 1
. 8 . 3 feature (11)
検索結果
-
Random
. urandom(size) -> String (18208.0) -
プラットフォームの提供する機能を使って、文字列を返します。
...る暗号化プリミティブが入手可能だとは期待できません」と
書いてあります。そのため、sizeとして32より大きい値を指定することには疑問の
余地があります。
//emlist[例][ruby]{
Random.urandom(8) #=> "\x78\x41\xBA\xAF\x7D\xEA\xD8\xEA"
//}... -
NEWS for Ruby 2
. 5 . 0 (108.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...onSequence#trace_points を追加
* String
* String#-@ はフリーズされていない文字列の重複を排除します。
互換性のため、既にフリーズされている文字列には何もしません。 13077
* -"literal" (String#-@) は同じオブジェクトを......3295
* String#casecmp, String#casecmp? に文字列でない引数を与えた場合、TypeErrorを発生させずにnilを返すようにしました
13312
* String#start_with? は正規表現を受け取れるようになりました 13712
* String#delete_prefix, String#delete_pr......作用として O_NONBLOCK フラグをセットするのをやめました(Linux のみ)
13362
* Random
* Random.raw_seed は Random.urandom に名前を変更しました。
シードを必要としない用途で有用です。9569
* Socket
* Socket::Ifaddr#vhid を追... -
ruby 1
. 8 . 3 feature (48.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...。
$ ruby-1.8.2 -e 'p File.join(1, 2)'
"1/2"
$ ruby-1.8.3 -e 'p File.join(1, 2)'
-e:1:in `join': can't convert Fixnum into String (TypeError)
from -e:1
=== 2005-09-16
: File.extname [ruby] [compat]
与えられた pathname がピリオドで終る場合、ピ......0
mthd_taint.rb:11:in `foo': calling insecure method: foo (SecurityError)
from mthd_taint.rb:11
=== 2005-09-09
: String#* [ruby] [compat]
: String#[] [ruby] [compat]
空文字にも taint が伝播するようになりました。((<ruby-dev:26900>)) ((<ruby-dev:27121>))......なりました。
: rand(bignum) [bug]
負の ((<Bignum>)) を受け取っても 正の ((<Bignum>)) を返すようになりました。
=== 2005-01-03
: srand [compat]
引数を与えない場合、可能なら /dev/urandom を参照するようになりました。((<ruby-dev:25392>))... -
SecureRandom (24.0)
-
安全な乱数発生器のためのインターフェースを提供するモジュールです。 HTTP のセッションキーなどに適しています。
...数発生器をサポートしています。
* openssl
* /dev/urandom
上の安全な乱数発生器が使用できない場合、各メソッドは NotImplementedError を発生します。
# random hexadecimal string.
require 'securerandom'
p SecureRandom.hex(10) #=> "52750b30ffbc7de......8e4863e6b81b8"
p SecureRandom.hex(12) #=> "94b2fff3e7fd9b9c391a2306"
p SecureRandom.hex(13) #=> "39b290146bea6ce975c37cfc23"
# random base64 string.
require 'securerandom'
p SecureRandom.base64(10) #=> "EcmTPZwWRAozdA=="
p SecureRandom.base64(10) #=> "9b0nsevdwNuM/w=="
p SecureRandom.......#=> "l7XEiFja+8EKEtY="
p SecureRandom.base64(12) #=> "7kJSM/MzBJI+75j8"
p SecureRandom.base64(13) #=> "vKLJ0tXBHqQOuIcSIg=="
# random binary string.
require 'securerandom'
p SecureRandom.random_bytes(10) #=> "\016\t{\370g\310pbr\301"
p SecureRandom.random_bytes(10) #=> "\323U\030TO\234\...