See Title
irb(main):001:0>format("a") => "0A" irb(main):002:0>format("2D") => "2D"
def format_hex_string(byte) byte.upcase byte.to_i(16) >= 16 ? byte : "0" + byte end
No comments:
Post a Comment