document hash function