There was an error while loading. Please reload this page.
1 parent d4b5d25 commit 1ad210eCopy full SHA for 1ad210e
hexutils/NOTES.md
@@ -94,5 +94,31 @@ We were inspired to publish this humble Gem after we found ourselves copying it
94
by hand from project to project over the course of several years.
95
96
97
+### string2hex gem
98
99
+- <https://github.com/kadalscript/string2hex>
100
+
101
+Simple converter, binary string to hex string
102
103
+**Usage**
104
105
+```ruby
106
+"foobar".string2hex # => "666f6f626172"
107
108
+"666f6f626172".hex2string # => "foobar"
109
+```
110
111
+**Source**
112
113
114
+class String
115
+ def string2hex
116
+ self.unpack('H*').first
117
+ end
118
119
+ def hex2string
120
+ [self].pack('H*')
121
122
+end
123
124
0 commit comments