るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.200秒)
トップページ > ライブラリ:openssl[x] > クエリ:mask_bits![x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

クラス

検索結果

OpenSSL::BN#mask_bits!(n) -> self (18102.0)

自身を下位 n ビットでマスクし、破壊的に変更します。

...きい場合は例外 OpenSSL::BNError
が発生します。

//emlist[][ruby]{
require 'openssl'

bn = 0b1111_1111.to_bn

bn.mask_bits!(8)
p "%b" % bn # => "11111111"

bn.mask_bits!(3)
p "%b" % bn # => "111"
//}

@param n マスクするビット数
@raise OpenSSL::BNError 計算時...