تخطى إلى المحتوى الرئيسي

bin2hex

حوّل البيانات الثنائية إلى سلاسل hex والعكس على مستوى البايت — مثل دالتي PHP bin2hex() وhex2bin().

Input
0 chars | 0 bytes
Encode
Output
0 chars | 0 bytes

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. 1

    الصق إدخال hex أو ثنائي

    الصق سلسلة hex لرؤية تمثيل البايت الثنائي، أو الصق بايتات مُرمَّدة بـ hex لعرضها كتفريغ hex منسَّق.

  2. 2

    فحص البيانات على مستوى البايت

    يُعرض كل بايت كرقمين سداسيين. تُحذِّر الأداة تلقائيًا إذا أُدخل عدد فردي من أحرف hex وتُضيف صفرًا في البداية.

  3. 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 على مستوى البايت مطابق لسلوك PHP bin2hex() / hex2bin().
  • ✓ تحذير وتصحيح تلقائي لإدخال hex ذي طول فردي.
  • ✓ مفيد لحمولات البروتوكولات وإخراج التشفير وتحديات CTF.
  • ✓ يعمل بالكامل في المتصفح — لا تُرسل بيانات إلى أي خادم.

الميزات والمواصفات

أقصى حجم للملف
حتى 100 ميغابايت
الخصوصية
تُحذف الملفات بعد نحو ساعة
السعر
مجاني، بدون تسجيل
المعالجة
100% على الجهاز
بياناتك لا تغادر متصفحك — كل المعالجة محلية.لا حاجة لحساب أو تسجيل.مجاني بلا حدود للاستخدام.

الأسئلة الشائعة

ما الفرق بين bin2hex ومحوّل hex؟

محوّل hex يُحوّل سلاسل النص المقروءة للبشر من وإلى hex. bin2hex يُحوّل بيانات البايت الخام — حمولات البروتوكول الثنائية وبايتات الملفات وإخراج التشفير — التي قد لا تُشكّل نصًا صالحًا. استخدم bin2hex للفحص على مستوى البايت.

ما الذي تفعله دالة PHP bin2hex()، وهل يمكنني تكرارها هنا؟

تأخذ PHP bin2hex() سلسلة ثنائية وتُعيد سلسلة سداسية حيث يُمثَّل كل بايت برقمين سداسيين. هذه الأداة تُكرر هذا السلوك. السلسلة 'A' (ASCII 65 = 0x41) تُرمَّد إلى 41.

لماذا يُسبّب إدخال عدد فردي من أحرف hex تحذيرًا؟

يُمثّل الترميز السداسي دائمًا بايتات كاملة — كل بايت يساوي بالضبط حرفين سداسيين. العدد الفردي يعني أن البايت الأول غير مكتمل. تُضيف الأداة صفرًا في البداية وتُظهر تحذيرًا لتعلم أن الإدخال جُرِّح.

هل هذه الأداة مفيدة لتحديات CTF؟

نعم. كثير من تحديات CTF تتضمن تفريغات hex وحمولات ثنائية وطبقات ترميز. تتعامل هذه الأداة مع تحويل hex على مستوى البايت بسرعة في المتصفح دون الحاجة إلى أدوات محلية.

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 تُحوّل بين البيانات الثنائية والسلاسل السداسية على مستوى البايت، مُكرِّرةً دالتي PHP bin2hex() وhex2bin()، بالكامل في متصفحك.

Advertisement

Ad