czar

Version, currently master branch1 version
  • master branchlatestJul 29, 2025

github.com/coderobe/czar

xar unarchiver (.xar, .pkg, .xip)

4 stars
0 dependents
License: LGPL3

Installation

# Add this to your shard.yml
dependencies:
  czar:
    github: coderobe/czar
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
LGPL3
Author
Robin Broda
Target
  • czar from czar.cr

Dependencies

Runtime Dependencies

  • binary_parser*github: DanSnow/crystal-binary_parser, commit: 3934e71d210c1f2082a7a1e5ecc8cdfe397e79e2

README

czar

clean-room implementation of a XAR unarchiver

status

  • [x] Header
    • [x] Magic
    • [x] Header size
    • [x] Version
    • [x] TOC length (compressed)
    • [x] TOC length (uncompressed)
    • [x] Checksum algorithm
      • [x] None
      • [x] SHA1
      • [x] MD5
  • [x] TOC
    • [x] Extraction
    • [x] Parsing
    • [x] Checksum validation
  • [x] Heap
    • [x] Extraction
      • [x] gzip/zlib
      • [x] bzip2
    • [x] Checksum validation
  • [ ] File Metadata

current features

  • archive info
  • file listing
  • checksum validation
  • decompression

usage

Usage: czar [options] <xar_file>
Options:
  --strict      Fail extraction if any checksum validation fails
  --no-extract  Only validate checksums, don't extract files
  --help, -h    Show this help message

Files are extracted to ./<xar_file>.extracted/

examples

# Extract archive with checksum validation
./czar archive.xar

# Validate checksums only (no extraction)
./czar --no-extract archive.xar

# Strict mode - fail if any checksum is invalid
./czar --strict archive.xar

This project, initially authored by Mara Robin Broda in 2018, is licensed under the GNU Lesser General Public License v3.0