Skip to main content
Module

x/aleph/deps.ts>brotli.compress

The Full-stack Framework in Deno.
Very Popular
Go to Latest
function brotli.compress
import { brotli } from "https://deno.land/x/aleph@v0.3.0-alpha.2/deps.ts";
const { compress } = brotli;

Compress a byte array.

import { compress } from "https://deno.land/x/brotli/mod.ts";
const text = new TextEncoder().encode("X".repeat(64));
console.log(text.length);                   // 64 Bytes
console.log(compress(text).length);         // 10 Bytes

Parameters

input: Uint8Array

Input data.

optional
bufferSize: number = [UNSUPPORTED]

Read buffer size

optional
quality: number = [UNSUPPORTED]

Controls the compression-speed vs compression- density tradeoff. The higher the quality, the slower the compression.

optional
lgwin: number = [UNSUPPORTED]

Base 2 logarithm of the sliding window size.

Returns

Uint8Array