python - How to convert string "0671" or "0x45" into integer form with 0 and 0x in the beginning -


I wanted to create my own encryption algorithm and decryption algorithm, the encryption algorithm works fine Changes the value and octal representations But when I tried decryption, then the problem occurred because it is the string type in the following code as intrate ('0671') = 671, 0671. Is there any method to convert "Ox 56" to an integer form ??????

Note: The following string is optional octal and four hexagonal values ​​of hexa.

  ///////////// DECRYPTION // / (0, F4): G = L [i: i + 4] // for print gk /// L = "01630x7401620x6901560x67" f = len (l) k = 0 d = 0x = [] = k + 1 if (k% 2 == 0): p = g print p other: p = int (g ) There you are ( s  string); print p  

  int (s, 0)  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -