Chaîne ASCII en outil de conversion en ligne hexadécimal


Splitter


À propos deChaîne ASCII en outil de conversion en ligne hexadécimal:

Cet outil de conversion de chaîne en hexa ASCII en ligne vous aide à convertir une chaîne ASCII en tableau hexadécimal.

Les symboles fractionnés de tableaux hexadécimaux pris en charge incluent ("", " ", "0x", "0X", "\0x", "\0X", "\x", "\X") .

Norme de codage ASCII:

ASCII (American Standard Code for Information Interchange ) est un caractère codage standard ASCII standard le plus largement utilisé a une longueur de 7 bits, un total de 128 caractères différents. ASCII étendu a une longueur de 8 bits, 256 caractères différents. Droit d' auteur symbole © définition Dans la table ASCII étendue.

Hex (Hex):

Le système de nombres hexadécimaux comprend 16 caractères, dont (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) plus (a, b, e, d, e, f) 6 Caractère: le système de nombres hexadécimaux pouvant représenter n'importe quelle chaîne binaire de manière lisible, il est largement utilisé en informatique. Le système de couleur peut également être représenté sous forme de nombres hexadécimaux, de # 000000 (noir pur) à #FFFFFF (blanc pur).

comic ascii to hex

Lien:

Wikipedia (hex): https://en.wikipedia.org/wiki/Hexadecimal

Wikipedia (ASCII): https://en.wikipedia.org/wiki/ASCII

Conversion de chaîne ASCII en hexadécimal en Python:

import binascii


def ascii_to_hex(ascii_str):
    hex_str = binascii.hexlify(ascii_str.encode())
    return hex_str


ascii_input = 'This is an example.'
hex_output = ascii_to_hex(ascii_input)
print('hex result is:{0}'.format(hex_output))

-------------------
hex result is:b'5468697320697320616e206578616d706c652e'

Conversion de chaîne ASCII en hexadécimal en Java:

public class NumberConvertManager {
    public static String ascii_to_hex(String ascii_str) {
        StringBuilder hex_str = new StringBuilder();
        for (char ch : ascii_str.toCharArray()) {
            hex_str.append(Integer.toHexString((int) ch));
        }
        return hex_str.toString();
    }

    public static void main(String[] args) {
        String ascii_input = "This is an example.";
        String hex_output = ascii_to_hex(ascii_input);
        System.out.println("hex result is:" + hex_output);
    }
}

-------------------
hex result is:5468697320697320616e206578616d706c652e