0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

rubyでbin2hexとhex2bin

Last updated at Posted at 2021-11-21

phpのhex2binbin2hexに該当する処理をrubyでぱっと実現。

def hex2bin(value)
  [value].pack "H*"
end
def bin2hex(value)
  value.unpack "H*"
end

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?