npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

com.mrunbelievable.nativezip

v1.0.0

Published

An Burst compatible, auto-jobified implementation of the LZMA SDK

Readme

NativeZip

A Unity.Burst compatible, auto-jobified implementation of the LZMA SDK. The resulting compression data uses a custom header and is currently not compatible with the 7z file format.

Motivation

While several ZIP libraries are available for C#, they typically execute their compression and decompression logic as managed code and rely on external native DLLs for the performance-critical work. A Unity Burst-compatible implementation enables native execution speed while integrating seamlessly with the Unity Job System.

In addition, the original LZMA SDK leaves opportunities for further parallelization during the initialization stages of both compression and decompression, and contains several performance-related inefficiencies. NativeZip addresses these limitations through additional parallelism and targeted optimizations.

Finally, unlike most ZIP compression libraries, NativeZip exposes the full set of compression parameters, allowing fine-grained control over the behavior of the compression algorithm.

Usage

Within the root namespace NativeZip you have two types available to you:

  • ZipCompressed, as the Unity.Collections.NativeContainer, handling this libraries' API (requires manual memory management via Dispose() and Dispose(JobHandle)).
  • CompressionSettings with detailed XML documentation for all of the available compression parameters

To compress a file, first construct a new ZipCompressed instance with this constructor:

public ZipCompressed(Allocator allocator, CompressionSettings settings = default, long initialCapacity = 128)

Then you are able to compress your data with the following methods:

public JobHandle Compress(void* data, long numBytes, JobHandle inputDeps)
public JobHandle Compress(NativeArray<byte> data, JobHandle inputDeps)
public void Compress(void* data, long numBytes)
public void Compress(NativeArray<byte> data)

Note:

  • The variants not using JobHandle are jobified variants that enforce immediate completion.
  • Once a compression has been requested, you will not be able to compress anything else with that particular instance of ZipCompressed.

Unfortunately, there is no common interface for any NativeCollection, which is the reason for only exposing native pointers and native byte arrays to the API. Fortunately, you can easily convert any custom collection to a byte array with the following code snippet:

void* dataPtr = myNativeContainer.GetUnsafeReadOnlyPtr();
int numBytes = sizeof(T) * myNativeContainer.Length;
NativeArray<byte> alias = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray<byte>(dataPtr, numBytes, Allocator.None);

#if ENABLE_UNITY_COLLECTIONS_CHECKS        
NativeArrayUnsafeUtility.SetAtomicSafetyHandle(ref alias, NativeArrayUnsafeUtility.GetAtomicSafetyHandle(myNativeContainer));
#endif

To decompress a piece of data, use one of the following analogous decompression methods:

public JobHandle Decompress(void* dst, JobHandle inputDeps)
public JobHandle Decompress(NativeArray<byte> dst, JobHandle inputDeps)
public void Decompress(void* dst)
public void Decompress(NativeArray<byte> dst)

Note:

  • The variants not using JobHandle are jobified variants that enforce immediate completion.
  • You can perform decompression from a single ZipCompressed instance as many times as you wish.

Lastly, serialization is implemented and exposed via the following methods:

public void Serialize(System.IO.Stream stream)
public static ZipCompressed Deserialize(System.IO.Stream stream, Allocator allocator)

How To Install This Library

It is highly encouraged to use the Scoped Registries feature for installing NativeZip.

Installing using Scoped Registries:

  • Open your Unity project.
  • Go to Edit → Project Settings → Package Manager.
  • Under Scoped Registries, click + to add a new registry.
  • Enter the registry details:
  • Click Save.
  • Open Window → Package Manager.
  • In the package list, select My Registries.
  • Install NativeZip from the registry.

Why use a scoped registry?

  • Easy updates – Receive new versions directly through Unity’s Package Manager without manual downloads.
  • Version management – Switch, lock, or roll back versions cleanly using Unity’s built-in tooling.
  • Cleaner projects – No need to store package files inside your repository or project folder.
  • Dependency resolution – Unity automatically handles dependencies and compatibility.
  • Team-friendly – Everyone on the project uses the same source and versions with minimal setup.
  • Faster setup – Install in a few clicks instead of manually importing or maintaining local packages.
  • No IDE clutter – The package source code does not appear in your IDE, keeping your workspace focused on your own project code.

Donations

If this repository has been valuable to your projects and you'd like to support my work, consider making a donation.

donateBTC donatePP

public static ZipCompressed Deserialize(System.IO.Stream stream, Allocator allocator)