noraj/ctf-party

Hexadecimal IP encoder/decoder

noraj opened this issue · 0 comments

noraj commented

Hexadecimal IP encoder/decoder

irb(main):016:0> '0100007F'.scan(/.{2}/).map(&:hex2dec).reverse.join('.')
=> "127.0.0.1"

Often use in network (eg. on linux /proc/net/tcp)