るりまサーチ

最速Rubyリファレンスマニュアル検索!
473件ヒット [201-300件を表示] (0.057秒)
トップページ > クエリ:d[x] > クエリ:generate[x]

別のキーワード

  1. bigdecimal/util to_d
  2. float to_d
  3. integer to_d
  4. kernel $-d
  5. openssl d

検索結果

<< < 1 2 3 4 5 > >>

OpenSSL::BN.generate_prime(bits, safe=true, add=nil, rem=nil) -> OpenSSL::BN (6201.0)

ランダム(擬似乱数的)な bits ビットの素数を返します。

...します。

add に整数を渡すと、 p % add == rem であるような
素数pのみを返します。rem が nil の場合は rem=1と見なします。

@param bits 生成するランダム素数のビット数
@param safe true で安全な素数のみを生成する
@param add 生成する...

CSV#write_headers? -> bool (6112.0)

ヘッダを出力先に書き込む場合は真を返します。 そうでない場合は偽を返します。

...("date1,date2\n2018-07-09,2018-07-10")
csv.write_headers? # => nil

header = ["header1", "header2"]
row = ["row1_1", "row1_2"]
result = CSV.generate(headers: header, write_headers: false) do |csv|
csv.write_headers? # => false
csv << row
end
result # => "row1_1,row1_2\n"

result = CSV.generate(h...
...eaders: header, write_headers: true) do |csv|
csv.write_headers? # => true
csv << row
end
result # => "header1,header2\nrow1_1,row1_2\n"
//}

@see CSV.new...

JSON::State#indent=(string) (6112.0)

インデントに使用する文字列をセットします。

...[ruby]{
require "json"

json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
json_state.indent = " "
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{...

JSON.#dump(object, io = nil, limit = nil) -> String | IO (6106.0)

与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。

...たオブジェクトを JSON 形式の文字列に変換してダンプします。

与えられたオブジェクトを引数として JSON.#generate を呼び出します。


@param object ダンプするオブジェクトを指定します。

@param io IO のように write メソッドを...
...e "json"

JSON.dump({ name: "tanaka", age: 19 }) # => "{\"name\":\"tanaka\",\"age\":19}"
//}

//emlist[例][ruby]{
require "json"

File.open("test.txt", "w") do |f|
JSON.dump([[[[[[[[[[]]]]]]]]]], f, 10) # => #<File:test.txt>
JSON.dump([[[[[[[[[[[]]]]]]]]]]], f, 10) # => exceed depth limit (Ar...
...gumentError)
end
//}

@see Marshal, Marshal.#dump...

JSON.create_id -> String (6106.0)

json_create メソッドで使用するクラスを決定するために使用する値を返します。

...ass User
attr :id, :name
d
ef initialize(id, name)
@id, @name = id, name
end

d
ef self.json_create(object)
new(object['id'], object["name"])
end

d
ef as_json(*)
{
JSON.create_id => self.class.name,
"id" => id,
"name" => name,
}
end

d
ef to_json(*)...
...as_json.to_json
end
end

json = JSON.generate(User.new(1, "tanaka"))
json # => "{\"json_class\":\"User\",\"id\":1,\"name\":\"tanaka\"}"
JSON.parse(json, create_additions: true)
# => #<User:0x0000557709b269e0 @id=1, @name="tanaka">
//}...

絞り込み条件を変える

JSON::State#indent -> String (6106.0)

インデントに使用する文字列を返します。

...インデントに使用する文字列を返します。

//emlist[例][ruby]{
require "json"

json_state = JSON::State.new(indent: "\t")
json_state.indent # => "\t"
JSON.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
//}...

OpenSSL::Random (6024.0)

OpenSSL が利用する擬似乱数生成器関連のモジュールです。

...ます。
このようなメソッドには以下のものがあります。
* OpenSSL::PKey::RSA.generate
* OpenSSL::PKey::DSA.generate
* OpenSSL::PKey::DH.generate
* OpenSSL::Cipher#random_key
そのような乱数は適切な実装を持つ擬似乱数生成器に適切なシードを渡...
...N.rand
* OpenSSL::BN.rand_range
* OpenSSL::BN.generate_prime
* OpenSSL::Cipher#random_iv
などでも利用されます。

擬似乱数生成器は適切なシードを与えられなければ正しく動作しません。
OpenSSL にはそのための API
* OpenSSL::Random.#random_add
*...
...OpenSSL::Random.#seed
* OpenSSL::Random.#load_random_file
が存在します。これらの API を模式的に説明すると、以下のようになります。
* シードの各ビットは統計的な乱雑さ、予測不可能性を持ち、ビット列の
乱雑さはエントロピ...

OpenSSL::PKey::DH (6018.0)

Diffie-Hellman 鍵共有クラス

...Diffie-Hellman 鍵共有クラス

D
iffie-Hellman 鍵共有プロトコルは署名ができないため、
OpenSSL::PKey::PKey#sign や OpenSSL::PKey::PKey#verify
を呼び署名や署名の検証を行おうとすると例外
OpenSSL::PKey::PKeyError が発生します。

D
iffie-Hellman はこ...
...require 'openssl'

# パラメータの生成
d
h = OpenSSL::PKey::DH.generate(1024, 5)
# パラメータのチェック
raise "bad DH parameter" unless dh.params_ok?
# 以下、dh1 と dh2 が通信の両端であるとする
# dh1 と dh2 は鍵パラメータ p と g を共有しな...
...することにしている

# dh1 は dh をそのまま使う
d
h1 = dh
# パラメータを複製して dh2 に渡す
d
h2 = OpenSSL::PKey::DH.new(dh)

# 両端が鍵パラメータから鍵対を生成する
d
h1.generate_key!
d
h2.generate_key!
# 通信の両端で公開鍵を...

rdoc/generator/json_index (6012.0)

他のジェネレータが生成する HTML で検索が行えるように、JSON の検索インデッ クスを生成するサブライブラリです。

...is derived from sdoc by Vladimir Kolesnikov and
contains verbatim code written by him.

このジェネレータは HTML ジェネレータと一緒に使うために設計されています。:

class RDoc::Generator::Darkfish
d
ef initialize options
# ...
@base_dir = Pathname.pwd....
...expand_path

@json_index = RDoc::Generator::JsonIndex.new self, options
end

d
ef generate
# ...
@json_index.generate
end
end

=== インデックスフォーマット

検索用のインデックスは JSON ファイルに出力されます。search_data という
...
...var search_data = {
"index": {
"searchIndex":
["a", "b", ...],
"longSearchIndex":
["a", "a::b", ...],
"info": [
["A", "A", "A.html", "", ""],
["B", "A::B", "A::B.html", "", ""],
...
]
}
}

searchIndex、longSearchIndex、info...
<< < 1 2 3 4 5 > >>