Module: KRB5::Mixin::Unpacker
- Included in:
- KeytabParser
- Defined in:
- lib/krb5/mixin/unpacker.rb
Instance Method Summary collapse
-
#unpack_bytes(length) ⇒ Array
Unpack raw bytes.
- #unpack_int16 ⇒ Object
- #unpack_int32 ⇒ Object
- #unpack_int8 ⇒ Object
Instance Method Details
#unpack_bytes(length) ⇒ Array
Unpack raw bytes
10 11 12 13 14 15 |
# File 'lib/krb5/mixin/unpacker.rb', line 10 def unpack_bytes(length) data = bytes[@index, length] @index += length data end |
#unpack_int16 ⇒ Object
24 25 26 27 28 29 |
# File 'lib/krb5/mixin/unpacker.rb', line 24 def unpack_int16 data = bytes[@index, 2].unpack1('s>') @index += 2 data end |
#unpack_int32 ⇒ Object
31 32 33 34 35 36 |
# File 'lib/krb5/mixin/unpacker.rb', line 31 def unpack_int32 data = bytes[@index, 4].unpack1('l>') @index += 4 data end |
#unpack_int8 ⇒ Object
17 18 19 20 21 22 |
# File 'lib/krb5/mixin/unpacker.rb', line 17 def unpack_int8 data = bytes[@index].unpack1('c') @index += 1 data end |