Inline implementation and tests for Hash ID.