summaryrefslogtreecommitdiff
path: root/magic/Magdir/sereal
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-01-02 20:23:27 +0000
committer <>2015-02-03 17:27:18 +0000
commit670c2bbcffe873a2b8589ed140c12e7923ef20c0 (patch)
tree41044880e826d60621a2d636ed71283de5e0e291 /magic/Magdir/sereal
parent3b49db406667ee7189b9ea69b9d9e0bdcc43c5b7 (diff)
downloadfile-670c2bbcffe873a2b8589ed140c12e7923ef20c0.tar.gz
Imported from /home/lorry/working-area/delta_file/file-5.22.tar.gz.file-5.22
Diffstat (limited to 'magic/Magdir/sereal')
-rw-r--r--magic/Magdir/sereal25
1 files changed, 25 insertions, 0 deletions
diff --git a/magic/Magdir/sereal b/magic/Magdir/sereal
new file mode 100644
index 0000000..7fa4503
--- /dev/null
+++ b/magic/Magdir/sereal
@@ -0,0 +1,25 @@
+
+#------------------------------------------------------------------------------
+# $File: sereal,v 1.2 2014/11/11 20:10:49 christos Exp $
+# sereal: file(1) magic the Sereal binary serialization format
+#
+# From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
+#
+# See the specification of the format at
+# https://github.com/Sereal/Sereal/blob/master/sereal_spec.pod#document-header-format
+#
+# I'd have liked to do the byte&0xF0 matching against 0, 1, 2 ... by
+# doing (byte&0xF0)>>4 here, but unfortunately that's not
+# supported. So when we print out a message about an unknown format
+# we'll print out e.g. 0x30 instead of the more human-readable
+# 0x30>>4.
+#
+# See https://github.com/Sereal/Sereal/commit/35372ae01d in the
+# Sereal.git repository for test Sereal data.
+0 string \=srl Sereal data
+!:mime application/sereal
+>4 byte&0x0F x (version %d,
+>4 byte&0xF0 0x00 uncompressed)
+>4 byte&0xF0 0x10 compressed with non-incremental Snappy)
+>4 byte&0xF0 0x20 compressed with incremental Snappy)
+>4 byte&0xF0 >0x20 unknown subformat, flag: %d>>4)