Strict Standards: Non-static method Soojung::addReferer() should not be called statically in /home/lifthrasiir/sites/sapzil.info/soojung/settings.php on line 79

Warning: Cannot modify header information - headers already sent by (output started at /home/lifthrasiir/sites/sapzil.info/soojung/settings.php:79) in /home/lifthrasiir/sites/sapzil.info/soojung/classes/Counter.class.php on line 63

Strict Standards: Non-static method Entry::getEntry() should not be called statically in /home/lifthrasiir/sites/sapzil.info/soojung/entry.php on line 51

Strict Standards: Non-static method Soojung::entryIdToFilename() should not be called statically in /home/lifthrasiir/sites/sapzil.info/soojung/classes/Entry.class.php on line 182

Strict Standards: Non-static method Soojung::queryFilenameMatch() should not be called statically in /home/lifthrasiir/sites/sapzil.info/soojung/classes/Soojung.class.php on line 55
TokigunStudio3 | 블로그: 가장 황당할 때

내용으로 바로 넘어 가기


TokigunStudio3

1 / 3283   


더 이상 이 블로그는 운영되지 않습니다. 새 블로그로 가 주세요.

가장 황당할 때

2004/10/02 PM 11:06 | 개발/역공학 | 0 comments | 0 trackbacks | AllBlog: vote, to pocket

지금까지 string.h 정도에 포함된 문자열 함수로 생각하던 함수가 해쉬 함수라는 걸 알았을 때. (...-_-) 근데 반환값 eax도 안 쓰면서 왜 함수를 만들어 놓은 걸까?

덤: 문제의 해쉬 알고리즘을 c로 기술한 것:

sub_446D30(char const *A, int B) {
  if(B == -1) B = strlen(A);
  if(!A) return -1;
  eax = 0x80 * ('A'<=*A && *A<='Z' ? *A+32 : *A);
  for(esi=B; esi--; A++)
    eax = (eax * 1000003) ^ ('A'<=*A && *A<='Z' ? *A+32 : *A);
  eax ^= B;
  return (eax==-1 ? -2 : eax);
}

TrackBack URL: http://sapzil.info/soojung/trackback.php?blogid=62

Copyright (c) 1995-2005, Kang Seonghoon (Tokigun).