fonction str2hex [résolu] - Version imprimable +- Communauté Eggdrop (https://forum.eggdrop.fr) +-- Forum : Eggdrop et TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=8) +--- Forum : Scripts TCL (https://forum.eggdrop.fr/forumdisplay.php?fid=4) +--- Sujet : fonction str2hex [résolu] (/showthread.php?tid=404) |
fonction str2hex [résolu] - MenzAgitat - 25/05/2009 J'ai besoin d'une fonction pour convertir une chaîne de caractères en hexadécimal (ou en octal, je m'accomoderai de l'un comme de l'autre) et je sèche. Des idées ? RE: fonction str2hex / str2oct - CrazyCat - 25/05/2009 Avec les commandes scan et format non ? tcl
Je ne suis vraiment pas certain de mon coup, mais c'est peut-être une piste. RE: fonction str2hex / str2oct - MenzAgitat - 25/05/2009 J'avais déjà essayé un truc comme ça mais format %x attend un entier et non un caractère. En plus, à vue de nez y'a rien qui fait avancer le while et ça va faire une boucle infinie. Edit : j'ai trouvé la solution du côté de binary : tcl
RE: fonction str2hex / str2oct - CrazyCat - 25/05/2009 Ah oui, j'ai zappé un substring Il faudrait donc convertir ta chaine en valeurs ascii non ? tcl
Je ne vois pas tellement comment convertir 'toto' en hexa sinon. RE: fonction str2hex [résolu] - MenzAgitat - 25/05/2009 J'ai trouvé la solution et édité mon message 2mn avant que tu ne valides ta réponse :p |