cute-hex 0.0.3 → 0.0.4
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 +3 -0
- data/lib/cute-hex/core.rb +2 -2
- 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: 069d925cce5b94292d5c883b4ba92449e663f11e
|
|
4
|
+
data.tar.gz: e928301b22bc46b79780d664091320a7a4f21cfc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c99fd19ba0ff5d0197b103d1df697ec2666d9bc3d9b66ee0697dd6ea0c53189af06aeadc911130ff2a7c3cf431316388dd425d1ca7065151dd030132dde91bc8
|
|
7
|
+
data.tar.gz: 2b1b013b2597ec4d81dcb0a9f92c0f7ac1f28df5be04a0dfe5b41d7a5ac860c029800eaf7ea6573d1b0ac108debbcc73fa34ed008e2fce2f6c9d0b2ad1dadb6a
|
data/README.md
CHANGED
|
@@ -10,7 +10,9 @@ a = 0xbeef
|
|
|
10
10
|
|
|
11
11
|
# Basic usage
|
|
12
12
|
CuteHex.x a # [0000 BEEF]
|
|
13
|
+
CuteHex.x nil # [???? ????]
|
|
13
14
|
CuteHex.x a, style: :data # 00 00 BE EF
|
|
15
|
+
CuteHex.x nil, style: :data # ?? ?? ?? ??
|
|
14
16
|
|
|
15
17
|
# Adjust word size
|
|
16
18
|
CuteHex.x a, word_size: 64 # [0000 0000 0000 BEEF]
|
|
@@ -23,6 +25,7 @@ CuteHex.x a, word_size: 64, slicer: :word, style: :data # 000000000000BEEF
|
|
|
23
25
|
|
|
24
26
|
# Remove trailing zeros, only work with :data style
|
|
25
27
|
CuteHex.x a, style: :data, pad_zeros: false # BE EF
|
|
28
|
+
CuteHex.x nil, style: :data, pad_zeros: false # ?? ?? ?? ??
|
|
26
29
|
```
|
|
27
30
|
|
|
28
31
|
Overriding default configuration
|
data/lib/cute-hex/core.rb
CHANGED
|
@@ -34,12 +34,12 @@ private
|
|
|
34
34
|
else word_size / 4
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
s = sprintf(format, _x).split('')
|
|
37
|
+
s = (_x ? sprintf(format, _x) : '?' * (word_size / 4)).split('')
|
|
38
38
|
output = s.each_slice(slice_by).map{ |x| x.join }.join(' ')
|
|
39
39
|
|
|
40
40
|
if @@config.debug_mode
|
|
41
41
|
p "Format: #{format}"
|
|
42
|
-
p "Sliced: #{s}"
|
|
42
|
+
p "Sliced: #{s} (#{_slicer} | #{slice_by})"
|
|
43
43
|
p "Output: #{output}"
|
|
44
44
|
end
|
|
45
45
|
|
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.4
|
|
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-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|