hexhelper 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -1
- data/lib/hexhelper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b6cea0da58d9efcbb5f7b35d67cb831aa8f156c
|
4
|
+
data.tar.gz: af3b60fbdf23bbfe5eb414da69586332726fe95b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 763e375faa501e97c887c7401bfd2bd3bb77e9c62a0de657db11ed28adb0fb6a68141bc6582704756c69a53dc2ec11bd124558b44108d8876041de19c1d7f8f4
|
7
|
+
data.tar.gz: aa5127f54de196c13e6ae3ce580135a6fbec7a7cfeecb7b2bcfd0bc59ded687f190def4d1f66536b05892653d2aa0220ec64d2eadd3137004bd832e80fe7e63a
|
data/README.md
CHANGED
@@ -29,7 +29,28 @@ Using it is simple!
|
|
29
29
|
require 'hexhelper'
|
30
30
|
|
31
31
|
str = "This is a test string\x00\x01\x02"
|
32
|
-
puts
|
32
|
+
puts HexHelper::to_s(str)
|
33
|
+
```
|
34
|
+
|
35
|
+
Which generates:
|
36
|
+
|
37
|
+
```
|
38
|
+
irb(main):001:0> require 'hexhelper'
|
39
|
+
=> true
|
40
|
+
irb(main):002:0> str = "This is a test string \x00\x01\x02"
|
41
|
+
=> "This is a test string \u0000\u0001\u0002"
|
42
|
+
irb(main):003:0> puts HexHelper::to_s(str)
|
43
|
+
00000000 54 68 69 73 20 69 73 20 61 20 74 65 73 74 20 73 This.is.a.test.s
|
44
|
+
00000010 74 72 69 6e 67 20 00 01 02 tring....
|
45
|
+
```
|
46
|
+
|
47
|
+
It's also possible to indent with the `indent` parameter, and to highlight a
|
48
|
+
particular offset with the `offset` parameter:
|
49
|
+
|
50
|
+
```
|
51
|
+
irb(main):004:0> puts HexHelper::to_s(str, indent: 4, offset: 0x10)
|
52
|
+
00000000 54 68 69 73 20 69 73 20 61 20 74 65 73 74 20 73 This.is.a.test.s
|
53
|
+
00000010 <74>72 69 6e 67 20 00 01 02 tring....
|
33
54
|
```
|
34
55
|
|
35
56
|
## Contributing
|
data/lib/hexhelper/version.rb
CHANGED