Do not try to use precomputed hash of foreign string.  Move hash code to cpp to allow easier debug.