Compute provisioning URL in separate function
This commit is contained in:
parent
6e2d0ff2ae
commit
eaf4036fc8
3 changed files with 45 additions and 7 deletions
15
ts/util/getProvisioningUrl.ts
Normal file
15
ts/util/getProvisioningUrl.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { arrayBufferToBase64 } from '../Crypto';
|
||||
|
||||
export function getProvisioningUrl(
|
||||
uuid: string,
|
||||
publicKey: ArrayBuffer
|
||||
): string {
|
||||
const params = new URLSearchParams({
|
||||
uuid,
|
||||
pub_key: arrayBufferToBase64(publicKey),
|
||||
});
|
||||
return `tsdevice:/?${params.toString()}`;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue