bin2hex
バイナリデータを16進文字列に変換し、16進をバイナリに戻します — PHPのbin2hex()とhex2bin()と同様のバイトレベル変換。
The `bin2hex` operation — converting raw binary bytes to their hexadecimal string representation — is a fundamental operation in systems programming, cryptography, and network protocol work. It is how you print a byte array in a debugger, how you display a cryptographic hash, and how you serialise binary data for storage in a text field or transmission in a JSON payload.
This tool converts binary data (entered as raw text, where each character is treated as its byte value) to a hex string, and reverses the process to convert a hex string back to binary. It operates at the byte level, making it the right tool for working with file signatures, hash values, binary protocol fields, and any situation where you need to inspect or construct the exact byte-level content of a value.
bin2hexをオンラインで使用する方法
- 1
16進またはバイナリ入力を貼り付ける
バイナリのバイト表現を確認するために16進文字列を貼り付けるか、フォーマットされた16進ダンプとして表示するために16進エンコードされたバイトを貼り付けてください。
- 2
バイトレベルのデータを検査
各バイトは2桁の16進数として表示されます。奇数の16進文字が入力された場合はツールが自動的に警告し、ゼロでパディングします。
- 3
結果をコピー
コード、プロトコルデバッグ、またはCTFチャレンジに使用するための16進またはバイナリ出力をコピーしてください。
How bin2hex Conversion Works
At the byte level, bin2hex is straightforward: each input byte is formatted as exactly two hex digits, zero-padded on the left if necessary, and the results are concatenated. The byte value 0 becomes `00`, 10 becomes `0a`, and 255 becomes `ff`. The output length is always exactly twice the input length in bytes — a predictable property that makes hex strings easy to work with programmatically: you can always extract byte N from a hex string by taking characters at positions `2N` and `2N+1`.
The reverse operation (hex-to-binary) splits the hex string into two-character groups, parses each as a base-16 integer, and emits the corresponding byte. Error handling is important: an odd-length hex string, a character outside `0-9a-fA-F`, or a value above `0xFF` in a group all indicate malformed input that must be rejected rather than silently truncated.
FileCrank bin2hexを使う理由
- ✓ PHPのbin2hex()/hex2bin()の動作に合わせたバイトレベルの16進変換。
- ✓ 奇数長の16進入力を自動的に警告・修正。
- ✓ プロトコルペイロード、暗号化出力、CTFチャレンジに便利。
- ✓ 完全にブラウザ内で動作 — データはサーバーに送信されません。
機能と仕様
よくある質問
bin2hexと16進コンバーターの違いは何ですか?
16進コンバーターは人間が読めるテキスト文字列と16進の間で変換します。bin2hexは生のバイトデータ(バイナリプロトコルペイロード、ファイルバイト、暗号化出力)を変換します。これらは有効なテキストを形成しない場合があります。バイトレベルの検査にはbin2hexを使用してください。
PHPのbin2hex()関数は何をしますか?ここで再現できますか?
PHPのbin2hex()はバイナリ文字列を取り、各バイトを2桁の16進数として表した16進文字列を返します。このツールはその動作を再現します。文字列'A'(ASCII 65 = 0x41)は41としてエンコードされます。
奇数の16進文字を入力すると警告が表示されるのはなぜですか?
16進エンコードは常に完全なバイトを表します — 各バイトはちょうど2つの16進文字です。奇数は最初のバイトが不完全であることを意味します。ツールは0でパディングして警告を表示するので、入力が調整されたことがわかります。
このツールはCTFチャレンジに役立ちますか?
はい。多くのCTFチャレンジには16進ダンプ、バイナリペイロード、エンコードレイヤーが含まれます。このツールはローカルツールを必要とせず、ブラウザ内でバイトレベルの16進変換を素早く処理します。
bin2hex vs. xxd vs. Python binascii
Python's `binascii.hexlify()` and `bytes.hex()` are the idiomatic in-code solution but require a script or REPL. The `xxd` command produces a formatted hex dump with address offsets and ASCII representation in columns — excellent for file inspection but verbose for extracting a single hex value. A browser-based bin2hex tool is the fastest option when you have a short binary string or hash value and need its hex form (or vice versa) right now, without writing code or opening a terminal.
関連ツール
FileCrank bin2hexはPHPのbin2hex()とhex2bin()関数を再現し、バイナリデータと16進文字列をバイトレベルで変換します。完全にブラウザ内で動作します。
Advertisement