replies working, need to add root post ID
This commit is contained in:
@@ -39,6 +39,20 @@ export async function compressString(input: string) {
|
||||
return compressedArray;
|
||||
}
|
||||
|
||||
export async function decompressBuffer(input: ArrayBuffer): Promise<string> {
|
||||
const decompressionStream = new DecompressionStream('gzip');
|
||||
const writer = decompressionStream.writable.getWriter();
|
||||
writer.write(new Uint8Array(input));
|
||||
writer.close();
|
||||
const decompressedBuffer = await new Response(decompressionStream.readable).arrayBuffer();
|
||||
return new TextDecoder().decode(decompressedBuffer);
|
||||
}
|
||||
|
||||
export async function base64ToArrayBuffer(base64: string): Promise<ArrayBuffer> {
|
||||
const response = await fetch("data:application/octet-stream;base64," + base64);
|
||||
return response.arrayBuffer();
|
||||
}
|
||||
|
||||
// Base58 character set
|
||||
// const BASE58_ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
||||
// Base58 encoding
|
||||
|
||||
Reference in New Issue
Block a user