signal-desktop/ts/util/getProvisioningUrl.ts
2021-09-23 17:49:05 -07:00

14 lines
378 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as Bytes from '../Bytes';
export function getProvisioningUrl(
uuid: string,
publicKey: Uint8Array
): string {
const url = new URL('sgnl://linkdevice');
url.searchParams.set('uuid', uuid);
url.searchParams.set('pub_key', Bytes.toBase64(publicKey));
return url.toString();
}