replies working, need to add root post ID
This commit is contained in:
@@ -31,6 +31,18 @@ export async function compressString(input) {
|
||||
// Convert the compressed data to a Uint8Array
|
||||
return compressedArray;
|
||||
}
|
||||
export async function decompressBuffer(input) {
|
||||
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) {
|
||||
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