14 for(p = va_arg(f->args, uchar*), e = p + HASHSZ; p != e; p++)
15 if(fmtprint(f, "%.2x", *p) < 0)
21 fhash(int fd, uchar p1[], uchar p2[], uchar h[])
29 if(memcmp(p1, p2, HASHSZ) > 0){
30 ds = sha1(p2, HASHSZ, nil, ds);
31 sha1(p1, HASHSZ, nil, ds);
33 ds = sha1(p1, HASHSZ, nil, ds);
34 sha1(p2, HASHSZ, nil, ds);
36 while((n = read(fd, buf, BUFSZ)) > 0)
37 sha1(buf, n, nil, ds);
44 hex2hash(char *s, uchar *h)
53 if(*s >= '0' && *s <= '9')
55 else if(*s >= 'a' && *s <= 'f')
57 else if(*s >= 'A' && *s <= 'F')
78 v |= (uvlong)h[i]<<(56-8*i);