cute-hex 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +31 -0
- data/lib/cute-hex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 55c4ec793ac6ff560cc76f4b17c0d98ec63f1aa2
|
|
4
|
+
data.tar.gz: 3414cc18b608d3dfd6d6830a78bab967470ca181
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53d10b62ac0348b5c497e7b57c2b746ccfefd0266afe0692f5815e63871830a04c7ad541595281202ee2d70ce05322e3d51fac6c9ecd7ed4780810a1967828ba
|
|
7
|
+
data.tar.gz: 01af1b0687e8f48ef05640d8eb7dc82acae64ef17bbabff21059cfa642fb53b1e3ff9d55eecc84fe2e4b0c162a24158fc1633966f39187e0a9a8abf1159fffd1
|
data/README.md
CHANGED
|
@@ -1,2 +1,33 @@
|
|
|
1
1
|
# cute-hex
|
|
2
2
|
Cute Hex
|
|
3
|
+
|
|
4
|
+
Prettify your hex dump
|
|
5
|
+
|
|
6
|
+
```
|
|
7
|
+
require 'cute-hex'
|
|
8
|
+
|
|
9
|
+
a = 0xbeef
|
|
10
|
+
|
|
11
|
+
# Basic usage
|
|
12
|
+
CuteHex.x a # [0000 BEEF]
|
|
13
|
+
CuteHex.x a, style: :data # 00 00 BE EF
|
|
14
|
+
|
|
15
|
+
# Adjust word size
|
|
16
|
+
CuteHex.x a, word_size: 64 # [0000 0000 0000 BEEF]
|
|
17
|
+
CuteHex.x a, style: :data, word_size: 16 # BE EF
|
|
18
|
+
|
|
19
|
+
# Adjust slicer, only work with :data style
|
|
20
|
+
CuteHex.x a, word_size: 64, slicer: :nibble, style: :data # 0000 0000 0000 BEEF
|
|
21
|
+
CuteHex.x a, word_size: 64, slicer: :half_word, style: :data # 00000000 0000BEEF
|
|
22
|
+
CuteHex.x a, word_size: 64, slicer: :word, style: :data # 000000000000BEEF
|
|
23
|
+
|
|
24
|
+
# Remove trailing zeros, only work with :data style
|
|
25
|
+
CuteHex.x a, style: :data, pad_zeros: false # BE EF
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Overriding default configuration
|
|
29
|
+
```
|
|
30
|
+
CuteHex.config.word_size= # in bits, default is 32
|
|
31
|
+
CuteHex.config.pad_zeros= # default is true
|
|
32
|
+
CuteHex.config.slicer= # :byte (default), :nibble, :half_word, :word
|
|
33
|
+
```
|
data/lib/cute-hex/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cute-hex
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gloria Budiman
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-02-
|
|
11
|
+
date: 2016-02-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|