Skip to main content
Module

x/lz4/src/lib.rs

πŸ—œ lz4 wasm module for deno
Go to Latest
File
// Copyright 2020-present the denosaurs team. All rights reserved. MIT license.
use lz4_compression::prelude::compress;use lz4_compression::prelude::decompress;use wasm_bindgen::prelude::wasm_bindgen;
#[cfg(feature = "wee_alloc")]#[global_allocator]static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[wasm_bindgen]pub fn lz4_compress(input: &[u8]) -> Vec<u8> { compress(input)}
#[wasm_bindgen]pub fn lz4_decompress(input: &[u8]) -> Vec<u8> { decompress(input).unwrap()}