Author

Topic: Master public key in another format? Desperate for help for an easy question! (Read 604 times)

copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
The first is a hex string, the second is a byte array.  Conversion between the two is pretty standard.  I would google "javascript conver hex to byte array".

HOOORAY I have done it finally!!!
Code:
function parseHexString(str) {
    var result = [];
    while (str.length >= 2) {
        result.push(parseInt(str.substring(0, 2), 16));
        str = str.substring(2, str.length);
    }

    return result;
}

Thanks. Thank you so very much!.

mmm should I close the thread or just delete it? It is not very informative to this community is it?


You will never know if someone might have the exact same question. Just close it, I also made your code look nice with code tags Wink
hero member
Activity: 924
Merit: 1001
Unlimited Free Crypto
The first is a hex string, the second is a byte array.  Conversion between the two is pretty standard.  I would google "javascript conver hex to byte array".

HOOORAY I have done it finally!!!

function parseHexString(str) {
    var result = [];
    while (str.length >= 2) {
        result.push(parseInt(str.substring(0, 2), 16));
        str = str.substring(2, str.length);
    }

    return result;
}

Thanks. Thank you so very much!.

mmm should I close the thread or just delete it? It is not very informative to this community is it?
donator
Activity: 1218
Merit: 1079
Gerald Davis
The first is a hex string, the second is a byte array.  Conversion between the two is a pretty standard programing task.  I would google "javascript convert hex to byte array".
hero member
Activity: 924
Merit: 1001
Unlimited Free Crypto
They are the same exact value.

The sequence of integers each represent one byte (0-255) or 8 bits.  A Hex value is 4 bits.  So it takes two hex digits to represent one byte.

0x5b = 91
0x8d = 141
...
0xde = 222

THANK YOU! I expected the same but for the love of god I don't know how to convert the first to the second! I am trying to do this in java script. Can you please give me some pointers? Do you know what data type is the second? how can I convert a "string" with the first to the second in javascript?
donator
Activity: 1218
Merit: 1079
Gerald Davis
They are the same exact value.

The sequence of integers each represent one byte (0-255) or 8 bits.  A Hex value is 4 bits.  So it takes two hex digits to represent one byte.

0x5b = 91
0x8d = 141
...
0xde = 222
hero member
Activity: 924
Merit: 1001
Unlimited Free Crypto
Hello all,

I will make it short not to waste your time.

 
Quote
5b8d161b69c4d417b1a3b83ad6a6d06653aefb7bfe1a88e0ae94f86b1709fe24650e6eb57b51204 658883af420c4ca146b958768f0724a4449a24f6a2397b1de

This string is a Master Public Key. But it is not related to my small question the nature of this string. What I know about it is that it is in Hex format

Now look at this array of integers

Quote
91,141,22,27,105,196,212,23,177,163,184,58,214,166,208,102,83,174,251,123,254,26,136,224,174,148,248,107,23,9,254,36,101,14,110,181,123,81,32,70,88,136,58,244,32,196,202,20,107,149,135,104,240,114,74,68,73,162,79,106,35,151,177,222


They are supposed to mean the same thing. The second array of integers is supposed to reflect either all or most of the Master Public Key above it. Can someone PLEASE help me understand what is the connection between them? In what format the integer array is and how to convert either from the first to the second or vice versa.

Thank you for reading and thank you for any help. I really appreciate it.

- Lophie
Jump to: