convert x1dxe3Gi%ax00x00x00x00 to 1de347692561
I use win7 and python 2.7.
I want to convert x1dxe3Gi%ax00x00x00x00 to 1de347692561.
How could I succeed in the conversion?
I have tried binascii.hexlify and codec.encode but all failed.[![enter image description here][1]][1]
python-2.7
add a comment |
I use win7 and python 2.7.
I want to convert x1dxe3Gi%ax00x00x00x00 to 1de347692561.
How could I succeed in the conversion?
I have tried binascii.hexlify and codec.encode but all failed.[![enter image description here][1]][1]
python-2.7
binascii.hexlify()
– glibdud
Jan 2 at 2:18
this does not work
– include
Jan 2 at 6:12
pls see the photo added
– include
Jan 2 at 6:18
2
What are the input and output types? Please don't post screenshots of text. Post the text and format it as code instead. We can't copy and play with a screenshot.
– Mad Physicist
Jan 2 at 6:50
add a comment |
I use win7 and python 2.7.
I want to convert x1dxe3Gi%ax00x00x00x00 to 1de347692561.
How could I succeed in the conversion?
I have tried binascii.hexlify and codec.encode but all failed.[![enter image description here][1]][1]
python-2.7
I use win7 and python 2.7.
I want to convert x1dxe3Gi%ax00x00x00x00 to 1de347692561.
How could I succeed in the conversion?
I have tried binascii.hexlify and codec.encode but all failed.[![enter image description here][1]][1]
python-2.7
python-2.7
edited Jan 2 at 8:17
include
asked Jan 2 at 2:07
includeinclude
133
133
binascii.hexlify()
– glibdud
Jan 2 at 2:18
this does not work
– include
Jan 2 at 6:12
pls see the photo added
– include
Jan 2 at 6:18
2
What are the input and output types? Please don't post screenshots of text. Post the text and format it as code instead. We can't copy and play with a screenshot.
– Mad Physicist
Jan 2 at 6:50
add a comment |
binascii.hexlify()
– glibdud
Jan 2 at 2:18
this does not work
– include
Jan 2 at 6:12
pls see the photo added
– include
Jan 2 at 6:18
2
What are the input and output types? Please don't post screenshots of text. Post the text and format it as code instead. We can't copy and play with a screenshot.
– Mad Physicist
Jan 2 at 6:50
binascii.hexlify()
– glibdud
Jan 2 at 2:18
binascii.hexlify()
– glibdud
Jan 2 at 2:18
this does not work
– include
Jan 2 at 6:12
this does not work
– include
Jan 2 at 6:12
pls see the photo added
– include
Jan 2 at 6:18
pls see the photo added
– include
Jan 2 at 6:18
2
2
What are the input and output types? Please don't post screenshots of text. Post the text and format it as code instead. We can't copy and play with a screenshot.
– Mad Physicist
Jan 2 at 6:50
What are the input and output types? Please don't post screenshots of text. Post the text and format it as code instead. We can't copy and play with a screenshot.
– Mad Physicist
Jan 2 at 6:50
add a comment |
2 Answers
2
active
oldest
votes
In your code, you don't hexlify the correct string, you hexlify read_key_final
, which is derived from a string representation of the list read_key_ascii_hex
. Therefore, you get
5b5c7831645c786533476925615c7830305c7830305c7830305c7830305d
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
[ x 1 d x e 3 G i % a x 0 0 x 0 0 x 0 0 x 0 0 ]
try read_key_ascii_hex = ''.join(i.decode("hex" for i in read_key))
instead (or two more replace
calls to remove the brackets).
add a comment |
This code works in both Python 2 and 3.
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = b'x1dxe3Gi%ax00x00x00x00'
>>> import binascii
>>> binascii.hexlify(x)
'1de34769256100000000'
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54000462%2fconvert-x1d-xe3gia-x00-x00-x00-x00-to-1de347692561%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
In your code, you don't hexlify the correct string, you hexlify read_key_final
, which is derived from a string representation of the list read_key_ascii_hex
. Therefore, you get
5b5c7831645c786533476925615c7830305c7830305c7830305c7830305d
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
[ x 1 d x e 3 G i % a x 0 0 x 0 0 x 0 0 x 0 0 ]
try read_key_ascii_hex = ''.join(i.decode("hex" for i in read_key))
instead (or two more replace
calls to remove the brackets).
add a comment |
In your code, you don't hexlify the correct string, you hexlify read_key_final
, which is derived from a string representation of the list read_key_ascii_hex
. Therefore, you get
5b5c7831645c786533476925615c7830305c7830305c7830305c7830305d
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
[ x 1 d x e 3 G i % a x 0 0 x 0 0 x 0 0 x 0 0 ]
try read_key_ascii_hex = ''.join(i.decode("hex" for i in read_key))
instead (or two more replace
calls to remove the brackets).
add a comment |
In your code, you don't hexlify the correct string, you hexlify read_key_final
, which is derived from a string representation of the list read_key_ascii_hex
. Therefore, you get
5b5c7831645c786533476925615c7830305c7830305c7830305c7830305d
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
[ x 1 d x e 3 G i % a x 0 0 x 0 0 x 0 0 x 0 0 ]
try read_key_ascii_hex = ''.join(i.decode("hex" for i in read_key))
instead (or two more replace
calls to remove the brackets).
In your code, you don't hexlify the correct string, you hexlify read_key_final
, which is derived from a string representation of the list read_key_ascii_hex
. Therefore, you get
5b5c7831645c786533476925615c7830305c7830305c7830305c7830305d
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
[ x 1 d x e 3 G i % a x 0 0 x 0 0 x 0 0 x 0 0 ]
try read_key_ascii_hex = ''.join(i.decode("hex" for i in read_key))
instead (or two more replace
calls to remove the brackets).
answered Jan 2 at 6:47
AemylAemyl
90011223
90011223
add a comment |
add a comment |
This code works in both Python 2 and 3.
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = b'x1dxe3Gi%ax00x00x00x00'
>>> import binascii
>>> binascii.hexlify(x)
'1de34769256100000000'
add a comment |
This code works in both Python 2 and 3.
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = b'x1dxe3Gi%ax00x00x00x00'
>>> import binascii
>>> binascii.hexlify(x)
'1de34769256100000000'
add a comment |
This code works in both Python 2 and 3.
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = b'x1dxe3Gi%ax00x00x00x00'
>>> import binascii
>>> binascii.hexlify(x)
'1de34769256100000000'
This code works in both Python 2 and 3.
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = b'x1dxe3Gi%ax00x00x00x00'
>>> import binascii
>>> binascii.hexlify(x)
'1de34769256100000000'
answered Jan 2 at 6:23
Manash MandalManash Mandal
663
663
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54000462%2fconvert-x1d-xe3gia-x00-x00-x00-x00-to-1de347692561%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
binascii.hexlify()
– glibdud
Jan 2 at 2:18
this does not work
– include
Jan 2 at 6:12
pls see the photo added
– include
Jan 2 at 6:18
2
What are the input and output types? Please don't post screenshots of text. Post the text and format it as code instead. We can't copy and play with a screenshot.
– Mad Physicist
Jan 2 at 6:50