summaryrefslogtreecommitdiff
path: root/magic/Magdir/compress
diff options
context:
space:
mode:
Diffstat (limited to 'magic/Magdir/compress')
-rw-r--r--magic/Magdir/compress61
1 files changed, 57 insertions, 4 deletions
diff --git a/magic/Magdir/compress b/magic/Magdir/compress
index beb8ebe..6fa8f32 100644
--- a/magic/Magdir/compress
+++ b/magic/Magdir/compress
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: compress,v 1.62 2014/09/13 14:27:12 christos Exp $
+# $File: compress,v 1.68 2017/05/25 20:07:23 christos Exp $
# compress: file(1) magic for pure-compression formats (no archives)
#
# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
@@ -188,6 +188,7 @@
>6 byte x version %d
>7 byte x \b.%d
!:mime application/x-7z-compressed
+!:ext 7z/cb7
# Type: LZMA
0 lelong&0xffffff =0x5d
@@ -201,6 +202,7 @@
# http://tukaani.org/xz/xz-file-format.txt
0 ustring \xFD7zXZ\x00 XZ compressed data
+!:strength * 2
!:mime application/x-xz
# https://github.com/ckolivas/lrzip/blob/master/doc/magic.header.txt
@@ -218,6 +220,56 @@
0 lelong 0x184c2102 LZ4 compressed data (v0.1-v0.9)
!:mime application/x-lz4
+# Zstandard/LZ4 skippable frames
+# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
+0 lelong&0xFFFFFFF0 0x184D2A50
+>(4.l+8) indirect x
+
+# Zstandard Dictionary ID subroutine
+0 name zstd-dictionary-id
+# Single Segment = True
+>0 byte &0x20 \b, Dictionary ID:
+>>0 byte&0x03 0 None
+>>0 byte&0x03 1
+>>>1 byte x %u
+>>0 byte&0x03 2
+>>>1 leshort x %u
+>>0 byte&0x03 3
+>>>1 lelong x %u
+# Single Segment = False
+>0 byte ^0x20 \b, Dictionary ID:
+>>0 byte&0x03 0 None
+>>0 byte&0x03 1
+>>>2 byte x %u
+>>0 byte&0x03 2
+>>>2 leshort x %u
+>>0 byte&0x03 3
+>>>2 lelong x %u
+
+# Zstandard compressed data
+# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
+0 lelong 0xFD2FB522 Zstandard compressed data (v0.2)
+!:mime application/x-zstd
+0 lelong 0xFD2FB523 Zstandard compressed data (v0.3)
+!:mime application/x-zstd
+0 lelong 0xFD2FB524 Zstandard compressed data (v0.4)
+!:mime application/x-zstd
+0 lelong 0xFD2FB525 Zstandard compressed data (v0.5)
+!:mime application/x-zstd
+0 lelong 0xFD2FB526 Zstandard compressed data (v0.6)
+!:mime application/x-zstd
+0 lelong 0xFD2FB527 Zstandard compressed data (v0.7)
+!:mime application/x-zstd
+>4 use zstd-dictionary-id
+0 lelong 0xFD2FB528 Zstandard compressed data (v0.8+)
+!:mime application/x-zstd
+>4 use zstd-dictionary-id
+
+# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
+0 lelong 0xEC30A437 Zstandard dictionary
+!:mime application/x-zstd-dictionary
+>4 lelong x (ID %u)
+
# AFX compressed files (Wolfram Kleff)
2 string -afx- AFX compressed file data
@@ -257,7 +309,8 @@
!:mime application/x-qpress
# Zlib https://www.ietf.org/rfc/rfc6713.txt
-0 beshort%31 =0
->0 byte&0xf =8
->>0 byte&0x80 =0 zlib compressed data
+0 string/b x
+>0 beshort%31 =0
+>>0 byte&0xf =8
+>>>0 byte&0x80 =0 zlib compressed data
!:mime application/zlib