/// <summary> /// Sees if the file name has a hash in the SFNT. /// </summary> /// <param name="name">The string to check.</param> /// <param name="key">The hash key.</param> /// <returns>The hash of the matching name. Null if the name doesn't exist.</returns> public uint getHashByName(string name, uint key) { foreach (string str in mNames) { if (str == name) { return(SARCFunctions.GetHash(name, key)); } } return(0); }
/// <summary> /// Gets a string by a given hash. /// </summary> /// <param name="hash">The hash to find in the file name table.</param> /// <param name="key">The hash key.</param> /// <returns>The string that matches the given hash.</returns> public string getStringFromHash(uint hash, uint key) { foreach (string str in mNames) { uint genHash = SARCFunctions.GetHash(str, key); if (genHash == hash) { return(str); } } return(""); }