Process text story messages
This commit is contained in:
parent
11d54f6769
commit
fc9bdf9398
17 changed files with 955 additions and 6 deletions
16
ts/util/generateBlurHash.ts
Normal file
16
ts/util/generateBlurHash.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { encode83 } from 'blurhash/dist/base83';
|
||||
|
||||
/* eslint-disable no-bitwise */
|
||||
export function generateBlurHash(argb = 4294704123): string {
|
||||
const R = 0xff & (argb >> 16);
|
||||
const G = 0xff & (argb >> 8);
|
||||
const B = 0xff & (argb >> 0);
|
||||
|
||||
const value = (R << 16) + (G << 8) + B;
|
||||
|
||||
return `00${encode83(value, 4)}`;
|
||||
}
|
||||
/* eslint-enable no-bitwise */
|
Loading…
Add table
Add a link
Reference in a new issue