How to concatenate two arbitrary long hex values?
Question:
I have two variables.
Variable A contains 1024 bytes (not always ascii characters, arbitrary hex values)
Variable B contains 64 bytes (not always ascii characters, arbitrary hex values)
How can I generate a variable C such that C = A || B ? (|| means concatenation)
Answers:
ummmm
A = 'x04x05x06'
B = 'x04x05x06'
C = A + B
The +
operator works on bytes too:
>>> b'x12x14' + b'x16x0b'
b'x12x14x16x0b'
to the last comment, if you try using in the print (C) function it does not work.. ummm its missing something..
you would need to revert to the previous comment before that being
for it to actually work.
A = b’x12x14′
B = b’x16x0b’
C = A + B
print (C)
I have two variables.
Variable A contains 1024 bytes (not always ascii characters, arbitrary hex values)
Variable B contains 64 bytes (not always ascii characters, arbitrary hex values)
How can I generate a variable C such that C = A || B ? (|| means concatenation)
ummmm
A = 'x04x05x06'
B = 'x04x05x06'
C = A + B
The +
operator works on bytes too:
>>> b'x12x14' + b'x16x0b'
b'x12x14x16x0b'
to the last comment, if you try using in the print (C) function it does not work.. ummm its missing something..
you would need to revert to the previous comment before that being
for it to actually work.
A = b’x12x14′
B = b’x16x0b’
C = A + B
print (C)