walrus
lz77 class algorithm 会把曾经出现过的字
LZ77 class algorithm 会把曾经出现过的字串转成 offset + length 的形式,上图 in 在目前位置 - 6 字元的位置曾经出现过,长度为 3;walrus in 在目前位置 - 21 个字元的位置曾经出现过,长度为 11。 把目前 cursor 的三个 byte 过 hash 查表,如果有查到且位置在可表示的范围,代表至少有三个 byte 可以重复利用,就把目前的位置 encode 成 copy item,然后更新表,最后再 update Lempel/Ziv boundary。