Forum
>>
Programmazione Python
>>
Calcolo scientifico
>>
decodificare una stringa
Pagina: 1
Esegui il login per scrivere una risposta.
Pagina: 1
Scritto da vale |
2021-12-28 16:55:30 - decodificare una stringa
|
Buonasera,
premetto che ho iniziato da poco a usare Python. Mi sono imbattuta in questo problema: ho una stinga in un elemento uint8[] che corrisponde a valori da 0 a 255. eehggehhdeagefhfddbcadbecbcdcdaciffabbfchaaddbdcecafabbedecccececdbfdehhfibcaabfddcgegaabacddfcbcbfeedfdccd`dccf`bag`dfceceddad`cefhggbfjde`bicfggffddfcgcefhehcddfchdgcfacdb`fegfifgdahceidiehjjghhddafhgdaggegaefkihngihhejifehjikjdkgjgighechgehde`dcb`dadddaddccfcdebdcacbcacafddecdadbacedbbadbcbc`a`bbccgdbfgdebekifidghdegbehfhfdfgihigifbcighidc`dcbefcccgceaddcfhdhfbdbbcdehddcccfddbceaecacbbb`bfegidfbfddbd`cfdegfchfeaeeidcbccgfbh``efcfgdhkhhhjimkkhffiljjnlhmgicbfeffgeefdbeggfdbaegfdeidcbfdhdjiihdhhhcc`dihfhifahehgdehhigjihhllemmlimgfjwrfmlnliflldbcfiijfhhhaehhhlmllqoqojlmnkfllorrqstgnirqmejppnkhqmjiijildghgehdihjnnnlkfklkkhiiaffgmkgejijhdihhhkefgddjklihjoqfnnqiimqmomnlnlikhedcgfhgjkihgighfhjfkikkhghmohhhacghehfeeghlkihdgfieh`cfddbachchcabadeeegedffdejkhkmrmpqslnkolrrsklqpxtsqpxsuyxxrqpprurrmqrslnifklckpkntvmplkjkjihhkdilknkincliibfjicfhkkjbdgchgklfeeiedhgiigihhijghggihchfehhhieoifknjnqqqihpomhklmlljkjgfkiehdchffgjhldefcgehcfgcfcaabhdegbgeddfchdgfbcehahehhiiighhfijgekiilhifhgiieigfhhjgehdfeedhhhkjidedhhifgdackjmhljgddhddchiklklgeehhfiejifhfhjihiegegifhffjikhighihieifhkhjehihghhjmgjlhjhcdhfebhichkjjgacbdfhaeeeefcigcagehf`hfkhnccebdeghhffgicgikdcccbdegjkifgbdgegeedeecafijbhkhcfcffgcecimlgefdbcac`edhejfhacfeecegihhcgkjjkjhhigeabadcgedgfdhebfcdchdbadeeihghedihiigfabcebbdbbdfhhhgeeehegehegf`adeehhecdahh`eehgebcfghdfegcdfaeabgbdgd^eacfgihhgcdabbdc`aachjhebcbebefgbhfggedbcfceaddbebdba_`bbed`cbfbdfjbe`cdaecdbggdfabbaaab`bdccgcfbebddddefchcome faccio a decodificarla? Grazie |
|
Scritto da vale |
2021-12-28 17:30:56 - Re: decodificare una stringa
|
Mi rispondo da sola...........
pixel=eehggehhdeagefhfddbcadbecbcdcdaciffabbfchaaddbdcecafabbedecccececdbfdehhfibcaabfddcgegaabacddfcbcbfeedfdccd`dccf`bag`dfceceddad`cefhggbfjde`bicfggffddfcgcefhehcddfchdgcfacdb`fegfifgdahceidiehjjghhddafhgdaggegaefkihngihhejifehjikjdkgjgighechgehde`dcb x=[ord(c) for c in pixel]# una lista |
|
Scritto da Gulshan Negi |
2024-01-12 10:16:41 - Re: decodificare una stringa
|
Well, by using below python script you can do this.
hex_string = "eehggehhdeagefhfddbcadbecbcdcdaciffabbfchaaddbdcecafabbedecccececdbfdehhfibcaabfddcgegaabacddfcbcbfeedfdccd`dccf`bag`dfceceddad`cefhggbfjde`bicfggffddfcgcefhehcddfchdgcfacdb`fegfifgdahce idiehjjghhddafhgdaggegaefkihngihhejifehjikjdkgjgighechgehde`dcb`dadddaddccfcdebdcacbcacafddecdadbacedbbadbcbc`a`bbccgdbfgdebekifidghdegbehfhfdfgihigifbcighidc`dcbefcccgceaddcfhdhfbdbbcdehddcccfdd bceaecacbbb`bfegidfbfddbd`cfdegfchfeaeeidcbccgfbh``efcfgdhkhhhjimkkhffiljjnlhmgicbfeffgeefdbeggfdbaegfdeidcbfdhdjiihdhhhcc`dihfhifahehgdehhigjihhllemmlimgfjwrfmlnliflldbcfiijfhhhaehhhlmllqoq ojlmnkfllorrqstgnirqmejppnkhqmjiijildghgehdihjnnnlkfklkkhiiaffgmkgejijhdihhhkefgddjklihjoqfnnqiimqmomnlnlikhedcgfhgjkihgighfhjfkikkhghmohhhacghehfeeghlkihdgfieh`cfddbachchcabadeeegedffdejkhkmrmpqslnk olrrsklqpxtsqpxsuyxxrqpprurrmqrslnifklckpkntvmplkjkjihhkdilknkincliibfjicfhkkjbdgchgklfeeiedhgiigihhijghggihchfehhhieoifknjnqqqihpomhklmlljkjgfkiehdchffgjhldefcgehcfgcfcaabhdegbgeddfchd gfbcehahehhiiighhfijgekiilhifhgiieigfhhjgehdfeedhhhkjidedhhifgdackjmhljgddhddchiklklgeehhfiejifhfhjihiegegifhffjikhighihieifhkhjehihghhjmgjlhjhcdhfebhichkjjgacbdfhaeeeefcigcagehf`hfkhnccebdeghhffgic gikdcccbdegjkifgbdgegeedeecafijbhkhcfcffgcecimlgefdbcac`edhejfhacfeecegihhcgkjjkjhhigeabadcgedgfdhebfcdchdbadeeihghedihiigfabcebbdbbdfhhhgeeehegehegf`adeehhecdahh`eehgebcfghdfegcdfaeabgbdgd^eacfgi hhgcdabbdc`aachjhebcbebefgbhfggedbcfceaddbebdba_` bbed`cbfbdfjbe`cdaecdbggdfabbaaab`bdccgcfbebddddefch" # Split the string into chunks of two characters each hex_chunks = [hex_string[i:i+2] for i in range(0, len(hex_string), 2)] # Convert each chunk to decimal and then to bytes decoded_bytes = bytes([int(chunk, 16) for chunk in hex_chunks]) # Decode the bytes to a string decoded_string = decoded_bytes.decode('utf-8') print(decoded_string) Thanks |
Pagina: 1
Esegui il login per scrivere una risposta.