Skip to content

Commit 1ad210e

Browse files
authored
Update NOTES.md
1 parent d4b5d25 commit 1ad210e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

hexutils/NOTES.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,31 @@ We were inspired to publish this humble Gem after we found ourselves copying it
9494
by hand from project to project over the course of several years.
9595

9696

97+
### string2hex gem
9798

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+
```ruby
114+
class String
115+
def string2hex
116+
self.unpack('H*').first
117+
end
118+
119+
def hex2string
120+
[self].pack('H*')
121+
end
122+
end
123+
```
98124

0 commit comments

Comments
 (0)