117件ヒット
[101-117件を表示]
(0.077秒)
別のキーワード
ライブラリ
- ビルトイン (33)
-
cgi
/ session (48) -
cgi
/ session / pstore (12) -
rubygems
/ dependency _ list (12) -
webrick
/ httpservlet / abstract (12)
クラス
- Array (21)
-
CGI
:: Session (12) -
CGI
:: Session :: FileStore (12) -
CGI
:: Session :: MemoryStore (12) -
CGI
:: Session :: NullStore (12) -
CGI
:: Session :: PStore (12) -
Gem
:: DependencyList (12) - String (12)
-
WEBrick
:: HTTPServlet :: AbstractServlet (12)
キーワード
-
do
_ OPTIONS (12) - pack (21)
-
remove
_ by _ name (12) - unpack (12)
検索結果
-
Array
# pack(template , buffer: String . new) -> String (19.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...であり、n, N, v, V
のサイズは常にシステム依存ではない(!をつけられない)ことに注意してください。
つまり、IO#ioctl などで C の構造体を渡すときのように、
システム依存のサイズとエンディアンに合わせる必要があるとき......(つまり最上位ビットはどこまでデータがあ
るかを示している)。
ISO/IEC 8825-1:1995 : Information technology−ASN.1 encoding rules : Specification of Basic Encoding Rules(BER) に定められる整数の符号化方法。
//emlist[][ruby]{
[0].pack("w") # =......0\x00by".unpack('ccxxcc') # => [82, 117, 98, 121]
//}
: Hexダンプを数値の配列に変換する例
//emlist[][ruby]{
"61 62 63 64 65 66".delete(' ').lines.pack('H*').unpack('C*')
# => [97, 98, 99, 100, 101, 102]
"61 62 63 64 65 66".split.collect {|c| c.hex}
# => [97, 98, 99, 100, 101, 102... -
String
# unpack(template) -> Array (19.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
...であり、n, N, v, V
のサイズは常にシステム依存ではない(!をつけられない)ことに注意してください。
つまり、IO#ioctl などで C の構造体を渡すときのように、
システム依存のサイズとエンディアンに合わせる必要があるとき......(つまり最上位ビットはどこまでデータがあ
るかを示している)。
ISO/IEC 8825-1:1995 : Information technology−ASN.1 encoding rules : Specification of Basic Encoding Rules(BER) に定められる整数の符号化方法。
//emlist[][ruby]{
[0].pack("w") # =......0\x00by".unpack('ccxxcc') # => [82, 117, 98, 121]
//}
: Hexダンプを数値の配列に変換する例
//emlist[][ruby]{
"61 62 63 64 65 66".delete(' ').lines.pack('H*').unpack('C*')
# => [97, 98, 99, 100, 101, 102]
"61 62 63 64 65 66".split.collect {|c| c.hex}
# => [97, 98, 99, 100, 101, 102...