Add varint encoding for library.