How to use the lz-string.compressToUint8Array function in lz-string

To help you get started, we’ve selected a few lz-string examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-pdf / site / src / lib / compress.js View on Github external
export const compress = str =>
  LZString.compressToUint8Array(str).reduce(
    (acc, value) => `${acc}${decimalToHex(value)}`,
    '',
  );
github saltyshiomix / react-ssr / packages / core / src / render / index.tsx View on Github external
const compressProps = (props: any) => {
  const packed = JSON.stringify(props);
  const compressed = Buffer.from(LZString.compressToUint8Array(packed));
  return URLSafeBase64.encode(compressed);
}
github saltyshiomix / react-ssr / packages / static / src / render / index.tsx View on Github external
const compressProps = (props: any) => {
  const packed = JSON.stringify(props);
  const compressed = Buffer.from(LZString.compressToUint8Array(packed));
  return URLSafeBase64.encode(compressed);
}
github masotime / json-url / src / main / compress.js View on Github external
		compress: async string => Buffer.from(lzstring.compressToUint8Array(string)),
		decompress: async buffer => lzstring.decompressFromUint8Array(buffer)