Thursday, December 25, 2014

[Ruby] string to hex, hex to string

String to Hex

require 'digest'
Digest.hexencode(string)
string.unpack('H*').first
Hex to String

[hex].pack('H*')
Credit: http://stackoverflow.com/a/17223012 



No comments:

Config number of file descriptors on Linux

Check file descriptor limit for a process. Vary depending on owner of the process $ cat /proc/{process-id}/limits Check current number of...