Edit distribution lists via story settings menu
This commit is contained in:
parent
9986d10947
commit
e321e1fea8
42 changed files with 2403 additions and 102 deletions
19
ts/util/uuidToBytes.ts
Normal file
19
ts/util/uuidToBytes.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { chunk } from 'lodash';
|
||||
import * as log from '../logging/log';
|
||||
|
||||
export function uuidToBytes(uuid: string): Uint8Array {
|
||||
if (uuid.length !== 36) {
|
||||
log.warn(
|
||||
'uuidToBytes: received a string of invalid length. ' +
|
||||
'Returning an empty Uint8Array'
|
||||
);
|
||||
return new Uint8Array(0);
|
||||
}
|
||||
|
||||
return Uint8Array.from(
|
||||
chunk(uuid.replace(/-/g, ''), 2).map(pair => parseInt(pair.join(''), 16))
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue