String compression implementation.