Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Rubyでバイトから2つのニブル(整数として)を取得する最も簡単な方法は何ですか?
「バイト」が 0 ~ 255 の数値の場合:
n1, n2 = (byte & 0xf0) >> 4, byte & 0x0f