Improved hash/id conversion

This one is less predictable and looks better.