sub shift_vector { my($vector, $length) = @_; return pack "b".($length - 1), substr unpack("b$length", $vector), 1; }