public static int hash(string s) { unchecked { if (string.Equals(s, default(string))) { return(0); } int key = default(int); { int acc = 0; { int _g1 = 0; int _g = s.Length; while ((_g1 < _g)) { int i = _g1++; acc = (((223 * ((acc >> 1))) + global::haxe.lang.StringExt.charCodeAt(s, i).@value) << 1); } } key = ((int)((((uint)(acc)) >> 1))); } global::haxe.root.Array <int> ids = global::haxe.lang.FieldLookup.fieldIds; int min = 0; int max = ids.length; while ((min < max)) { int mid = ((int)((min + (((double)(((max - min)))) / 2)))); int imid = ids[mid]; if ((key < imid)) { max = mid; } else { if ((key > imid)) { min = (mid + 1); } else { string field = global::haxe.lang.Runtime.toString(global::haxe.lang.FieldLookup.fields[mid]); if (!(string.Equals(field, s))) { return(~(key)); } return(key); } } } ids.insert(min, key); global::haxe.lang.FieldLookup.fields.insert(min, s); return(key); } }