Function lastN [src]
Retrieve the n-th last byte
Prototype
pub fn lastN(self: Self, dist: usize) !u8
Parameters
self: Self
dist: usize
Source
pub fn lastN(self: Self, dist: usize) !u8 {
if (dist > self.dict_size or dist > self.len) {
return error.CorruptInput;
}
const offset = (self.dict_size + self.cursor - dist) % self.dict_size;
return self.get(offset);
}