Precompute hash in native extensions