2件ヒット
[1-2件を表示]
(0.078秒)
ライブラリ
- securerandom (2)
検索結果
先頭2件
-
SecureRandom
. base64(n = nil) -> String (54376.0) -
ランダムな base64 文字列を生成して返します。
...3 倍になります。nil を指定した場合 n として 16 が使われます。
@raise NotImplementedError 安全な乱数発生器が使えない場合に発生します。
require 'securerandom'
p SecureRandom.base64(3) #=> "4pYO" (文字列のサイズは 3 でない)
@see 3548... -
SecureRandom
. urlsafe _ base64(n = nil , padding = false) -> String (18448.0) -
ランダムで URL-safe な base64 文字列を生成して返します。
...に発生します。
require 'securerandom'
p SecureRandom.urlsafe_base64 #=> "b4GOKm4pOYU_-BOXcrUGDg"
p SecureRandom.urlsafe_base64 #=> "UZLdOkzop70Ddx-IJR0ABg"
p SecureRandom.urlsafe_base64(nil, true) #=> "i0XQ-7gglIsHGV2_BNPrdQ=="
p SecureRandom.urlsafe_base64(nil, true) #=> "-M8...