Editing PFS

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 196: Line 196:


<source lang="c">
<source lang="c">
uint32_t fptbl_hash(const char* filename){
uint32_t fptbl_hash(char* filename){
   int i;
   int i;
  // convert to upper case
  for(i = 0; filename[i]; i++) {
    if(filename[i] >= 'a' && filename[i] <= 'z')
      filename[i] -= 32;
  }
  // compute hash
   uint32_t hash = 0;
   uint32_t hash = 0;
   for(i = 0; filename[i]; i++) {
   for(i = 0; filename[i]; i++) {
     // convert character to uppercase
     hash = filename[i] + 31 * hash;
    char c = (filename[i] >= 'a' && filename[i] <= 'z') ? (filename[i] - 32) : filename[i];
    hash = c + 31 * hash;
   }
   }
   return hash;
   return hash;
Please note that all contributions to PS4 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS4 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)