1275698Sdelphij 2267843Sdelphij#------------------------------------------------------------------------------ 3284237Sdelphij# $File: sereal,v 1.3 2015/02/05 19:14:45 christos Exp $ 4267843Sdelphij# sereal: file(1) magic the Sereal binary serialization format 5267843Sdelphij# 6267843Sdelphij# From: ��var Arnfj��r�� Bjarmason <avarab@gmail.com> 7267843Sdelphij# 8267843Sdelphij# See the specification of the format at 9267843Sdelphij# https://github.com/Sereal/Sereal/blob/master/sereal_spec.pod#document-header-format 10267843Sdelphij# 11267843Sdelphij# I'd have liked to do the byte&0xF0 matching against 0, 1, 2 ... by 12267843Sdelphij# doing (byte&0xF0)>>4 here, but unfortunately that's not 13267843Sdelphij# supported. So when we print out a message about an unknown format 14267843Sdelphij# we'll print out e.g. 0x30 instead of the more human-readable 15267843Sdelphij# 0x30>>4. 16267843Sdelphij# 17267843Sdelphij# See https://github.com/Sereal/Sereal/commit/35372ae01d in the 18267843Sdelphij# Sereal.git repository for test Sereal data. 19284237Sdelphij0 name sereal 20284237Sdelphij>4 byte&0x0F x (version %d, 21284237Sdelphij>4 byte&0xF0 0x00 uncompressed) 22284237Sdelphij>4 byte&0xF0 0x10 compressed with non-incremental Snappy) 23284237Sdelphij>4 byte&0xF0 0x20 compressed with incremental Snappy) 24284237Sdelphij>4 byte&0xF0 >0x20 unknown subformat, flag: %d>>4) 25284237Sdelphij 26284237Sdelphij0 string/b \=srl Sereal data packet 27267843Sdelphij!:mime application/sereal 28284237Sdelphij>&0 use sereal 29284237Sdelphij0 string/b \=\xF3rl Sereal data packet 30284237Sdelphij!:mime application/sereal 31284237Sdelphij>&0 use sereal 32284237Sdelphij0 string/b \=\xC3\xB3rl Sereal data packet, UTF-8 encoded 33284237Sdelphij!:mime application/sereal 34284237Sdelphij>&0 use sereal 35284237Sdelphij 36