Structure

compression_algorithm

A structure for values that represent compression algorithms.

Declaration

struct compression_algorithm

Overview

Choose an algorithm according to the following guidelines:

  • If speed and compression ratio are important, use COMPRESSION_LZFSE. If you require interoperability with non-Apple devices, use COMPRESSION_ZLIB.

  • Use COMPRESSION_LZ4 if speed is critical, and you are willing to sacrifice compression ratio to achieve it.

  • Use COMPRESSION_LZMA if compression ratio is critical, and you are willing to sacrifice speed to achieve it. Note that COMPRESSION_LZMA is an order of magnitude slower for both compression and decompression than other choices.

COMPRESSION_LZFSE is faster than COMPRESSION_ZLIB, and generally achieves a better compression ratio. However, it is slower than COMPRESSION_LZ4 and does not compress as well as COMPRESSION_LZMA, so you will still want to use COMPRESSION_LZ4 if speed is critical or COMPRESSION_LZMA if compression ratio is critical.

Topics

Algorithm Constants

var COMPRESSION_LZFSE: compression_algorithm

The LZFSE compression algorithm, that is recommended for use on Apple platforms.

var COMPRESSION_LZ4: compression_algorithm

The LZ4 compression algorithm, that is recommended for fast compression.

var COMPRESSION_LZ4_RAW: compression_algorithm

The LZ4 compression algorithm, without frame headers.

var COMPRESSION_LZMA: compression_algorithm

The LZMA compression algorithm, that is recommended for high-compression ratio.

var COMPRESSION_ZLIB: compression_algorithm

The zlib compression algorithm, that is recommended for cross-platform compression.

Initializers

init(UInt32)

Creates a new constant from the given raw value.

init(rawValue: UInt32)

Creates a new constant from the given raw value.

Instance Properties

var rawValue: UInt32

The raw value of the constant.

Relationships