зеркало из https://github.com/mozilla/libprio.git
per bug 1465251, switch to sync version of PrioEncoder.encode()
This commit is contained in:
Родитель
f1087cb6c4
Коммит
7bb69953ce
|
@ -13,25 +13,22 @@ let [publicKeyA, publicKeyB, batchID, param1, param2, param3] = arguments;
|
|||
Services.prefs.setStringPref('prio.publicKeyA', publicKeyA);
|
||||
Services.prefs.setStringPref('prio.publicKeyB', publicKeyB);
|
||||
|
||||
async function test() {
|
||||
let params = {
|
||||
'browserIsUserDefault': Number(param1),
|
||||
'newTabPageEnabled': Number(param2),
|
||||
'userChromeCssLoaded': Number(param3)
|
||||
};
|
||||
let params = {
|
||||
'browserIsUserDefault': Number(param1),
|
||||
'newTabPageEnabled': Number(param2),
|
||||
'userChromeCssLoaded': Number(param3)
|
||||
};
|
||||
|
||||
try {
|
||||
let result = await PrioEncoder.encode(batchID, params);
|
||||
try {
|
||||
let result = PrioEncoder.encode(batchID, params);
|
||||
|
||||
const toHexString = bytes =>
|
||||
bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0') + ',', '');
|
||||
const toHexString = bytes =>
|
||||
bytes.reduce((str, byte) => str + byte.toString(16).padStart(2, '0') + ',', '');
|
||||
|
||||
console.log(toHexString(result.a) + '$' + toHexString(result.b));
|
||||
console.log('');
|
||||
} catch(e) {
|
||||
console.log('Failure.', e);
|
||||
console.log(v);
|
||||
}
|
||||
console.log(toHexString(result.a) + '$' + toHexString(result.b));
|
||||
console.log('');
|
||||
} catch(e) {
|
||||
console.log('Failure.', e);
|
||||
console.log(v);
|
||||
}
|
||||
|
||||
test().then();
|
||||
|
|
Загрузка…
Ссылка в новой задаче