add id compression utilities

Untested!