History

devfs-win32: use sha1() for pathhash

cinap_lenrek committed 10 years ago

Commit 969f1e11 parent 693b8861 file · +7 −5Browse files

Unified · Split

kern/devfs-win32.c+7−5
@@ -9,6 +9,8 @@ · 8 unmodified lines
9#include "fns.h"9#include "fns.h"
10#include "error.h"10#include "error.h"
11 11
12#include <libsec.h> /* for sha1 in pathhash() */
13
12typedef struct DIR DIR;14typedef struct DIR DIR;
13typedef struct Ufsinfo Ufsinfo;15typedef struct Ufsinfo Ufsinfo;
14 16
@@ -65,11 +67,11 @@ unixtime(FILETIME *ft) · 50 unmodified lines
65static uvlong67static uvlong
66pathhash(TCHAR *p)68pathhash(TCHAR *p)
67{69{
68 uvlong h;70 uchar digest[SHA1dlen];
69 h = 0LL;71 int n;
70 for(; *p; p++)72 for(n=0; p[n] != 0; n++);
71 h += *p * 13;73 sha1((uchar*)p, n*sizeof(TCHAR), digest, nil);
72 return h;74 return *(uvlong*)digest;
73}75}
74 76
75static ulong77static ulong

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t