static DWORD userinfo_hash(void* pKey, DWORD dwIndex, void* data) { switch ((USERINFO_KEY) dwIndex) { case USERINFO_UID: case USERINFO_GID: return *(DWORD*) pKey; case USERINFO_SID: case USERINFO_UPN: return generic_hash(pKey, strlen((const char*) pKey)); } return 0; }
void octstr_whirlpool(octstr_t *dst, octstr_t *src) { generic_hash(dst, src, whirlpool, 64); }
void octstr_sha256(octstr_t *dst, octstr_t *src) { generic_hash(dst, src, sha256, 32); }
void octstr_sha1(octstr_t *dst, octstr_t *src) { generic_hash(dst, src, sha1, 20); }
void octstr_md5(octstr_t *dst, octstr_t *src) { generic_hash(dst, src, md5, 16); }