bin2hex
המר נתונים בינאריים למחרוזות hex ו-hex לבינארי ברמת ה-byte — כמו 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
הדבק קלט hex או בינארי
הדבק מחרוזת hex לראיית ייצוג ה-byte הבינארי, או הדבק bytes מקודדות hex לצפייה כ-hex dump מעוצב.
- 2
בדוק נתונים ברמת ה-byte
כל byte מוצג כשתי ספרות hex. הכלי מזהיר אוטומטית אם מוזן מספר אי-זוגי של תווי hex ומוסיף אפס בהתחלה.
- 3
העתק את התוצאה
העתק את הפלט hex או הבינארי לשימוש בקוד, ניפוי פרוטוקולים, או אתגרי CTF.
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.
למה להשתמש ב-bin2hex של FileCrank?
- ✓ המרת hex ברמת ה-byte תואמת להתנהגות PHP bin2hex() / hex2bin().
- ✓ אזהרה ותיקון אוטומטי של קלט hex באורך אי-זוגי.
- ✓ שימושי לעומסי פרוטוקולים, פלט קריפטוגרפי ואתגרי CTF.
- ✓ פועל לחלוטין בדפדפן — שום נתון לא נשלח לשרת.
תכונות ומפרטים
שאלות נפוצות
מה ההבדל בין bin2hex לממיר hex?
ממיר hex ממיר מחרוזות טקסט קריאות לאדם מ-hex ואליו. bin2hex ממיר נתוני byte גולמיים — עומסי פרוטוקול בינאריים, bytes קובץ, פלט קריפטוגרפי — שעשויים לא להרכיב טקסט חוקי. השתמש ב-bin2hex לבדיקה ברמת ה-byte.
מה עושה פונקציית PHP bin2hex(), ואפשר לשכפל אותה כאן?
PHP bin2hex() לוקחת מחרוזת בינארית ומחזירה מחרוזת הקסדצימלית שבה כל byte מיוצג כשתי ספרות hex. הכלי הזה משכפל את ההתנהגות הזו. המחרוזת 'A' (ASCII 65 = 0x41) מקודדת ל-41.
למה הזנת מספר אי-זוגי של תווי hex גורמת לאזהרה?
קידוד hex תמיד מייצג bytes שלמים — כל byte הוא בדיוק שני תווי hex. מספר אי-זוגי אומר שה-byte הראשון לא שלם. הכלי מוסיף 0 בהתחלה ומציג אזהרה כדי שתדע שהקלט הותאם.
האם הכלי הזה שימושי לאתגרי CTF?
כן. אתגרי CTF רבים כוללים hex dumps, עומסים בינאריים ושכבות קידוד. הכלי הזה מטפל בהמרת hex ברמת ה-byte במהירות בדפדפן ללא צורך בכלים מקומיים.
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.
כלים קשורים
bin2hex של FileCrank ממיר בין נתונים בינאריים ומחרוזות הקסדצימליות ברמת ה-byte, משכפל את פונקציות PHP bin2hex() ו-hex2bin(), לחלוטין בדפדפן שלך.
Advertisement