るりまサーチ (Ruby 3.1)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.056秒)

別のキーワード

  1. securerandom hex
  2. string hex
  3. _builtin hex
  4. ipv6 regex_8hex
  5. resolv regex_8hex

ライブラリ

検索結果

SecureRandom.hex(n = nil) -> String (54376.0)

ランダムな hex 文字列を生成して返します。

...n の 2 倍になります。nil を指定した場合 n として 16 が使われます。

@raise NotImplementedError 安全な乱数発生器が使えない場合に発生します。

require 'securerandom'
p SecureRandom.hex(3) #=> "f72233" (文字列のサイズは 3 でない)...