symeapp/srp-client — pull request #7 by YiyangLi (2014-12-04 19:13:26+00:00)
Title: 1. Add toHexStr to fix the bug in hashing small integer in JS, as hash(2...

...) != hash(0x02) != hash(0x2); 2. Add bnToByteArrayUnsigned to translate the big integer to *unsigned* byte array.

1. Add utfHash, abc should be hash('abc'), hexHash('0x616263'), or utfHash('abc')

'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'

2. Add hexStr to convert a small integer to a %02X, if srp.g is 2, it will be converted to 0x02, instead of 0x2.

-- if we need to hash integer 2, we should convert it to 0x02 and hash 0x02, it should be hexHash(0x02)

dbc1b4c900ffe48d575b5da5c638040125f65db0fe3e24494b76ea986457d986

however, srp.hexHash(srp.two.toString(16)) gives me '21e3aac0017e45efb3bb4a7022e3aa5b01e6e1e703ab7bf71d12c19f6f4d6658' (sha-256), which is 0x2

3. Add bnToByteArrayUnsigned