Skip to content
Snippets Groups Projects
Commit 0ddfc0a1 authored by Millicent Billette's avatar Millicent Billette
Browse files

Merge remote-tracking branch 'origin/main' into main

parents 40f8e875 b8440c14
No related branches found
No related tags found
No related merge requests found
Pipeline #17337 failed
......@@ -13,6 +13,8 @@ const sha256 = sha();
const generateKeypair = nacl.sign.keyPair.fromSeed;
export const isPubkey = (value) => /^[A-HJ-NP-Za-km-z1-9]{42,45}$/.test(value)
export async function idSecPass2rawAll(idSec, pass) {
const rawSeed = await saltPass2seed(idSec, pass);
const keyPair = seed2keyPair(rawSeed);
......
......@@ -30,6 +30,7 @@ test('array sign string', async t => t.is((await app.sign(unsignedDocument, secr
test('uint8array sign string', async t => t.is((await app.sign(unsignedDocument, secretKey, 'uint8array'))[0], 27));
test('sign throw for bad output format', async t => t.throwsAsync(() => app.sign(unsignedDocument, secretKey, 'whattt ?')));
test("is a pubkey", (t) => t.is(app.isPubkey(pubKey), true));
test('b58 should decode/encode well', t => t.is(app.b58.encode(app.b58.decode(pubKey)), pubKey));
test('b58 on pubKey with leading 1', t => t.is(app.b58.encode(app.b58.decode('12BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx')), '12BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx'));
test('b58 on pubKey without leading 1', t => t.is(app.b58.encode(app.b58.decode('2BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx')), '2BjyvjoAf5qik7R8TKDJAHJugsX23YgJGi2LmBUv2nx'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment