Use dchest/uniuri rather than copying code from it.

Fixes #6