From 0f89b06207d0a88a836510bd59b8aa54b817f6ca Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sat, 7 Sep 2019 11:23:52 +1000 Subject: [PATCH] Rename RAC's Zstandard Short Codec value The bits in the byte no longer need to be independent. We can enumerate 0, 1, 2, etc instead of 1<<0, 1<<1, 1<<2, etc. --- doc/spec/rac-spec.md | 2 +- lib/rac/rac.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/spec/rac-spec.md b/doc/spec/rac-spec.md index de6e1e3e..55ac25a7 100644 --- a/doc/spec/rac-spec.md +++ b/doc/spec/rac-spec.md @@ -303,7 +303,7 @@ compression algorithm: - `0x00` means "RAC + Zeroes". - `0x01` means "RAC + Zlib". - `0x02` means "RAC + LZ4". - - `0x04` means "RAC + ZStandard". + - `0x03` means "RAC + Zstandard". - All other values are reserved. For `Long Codec`s, the remaining low 6 bits of the `Codec Byte` define a number diff --git a/lib/rac/rac.go b/lib/rac/rac.go index e5215868..9b464e59 100644 --- a/lib/rac/rac.go +++ b/lib/rac/rac.go @@ -84,7 +84,7 @@ func (c Codec) name() string { return "Zlib" case 2: return "LZ4" - case 4: + case 3: return "Zstandard" } } @@ -99,7 +99,7 @@ const ( CodecZeroes = Codec(0x00 << 56) CodecZlib = Codec(0x01 << 56) CodecLZ4 = Codec(0x02 << 56) - CodecZstandard = Codec(0x04 << 56) + CodecZstandard = Codec(0x03 << 56) codecMixBit = Codec(1 << 62) codecLongZeroes = Codec(1 << 63)