1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

* Did something useful while waiting at IAD: reference scanning is now

much faster.
This commit is contained in:
Eelco Dolstra 2005-11-16 08:27:06 +00:00
parent 9311ab76a5
commit b7f008fc35
5 changed files with 52 additions and 31 deletions

View file

@ -109,13 +109,15 @@ static unsigned char divMod(unsigned char * bytes, unsigned char y)
// omitted: E O U T
char chars[] = "0123456789abcdfghijklmnpqrsvwxyz";
const string base32Chars = "0123456789abcdfghijklmnpqrsvwxyz";
string printHash32(const Hash & hash)
{
Hash hash2(hash);
unsigned int len = (hash.hashSize * 8 - 1) / 5 + 1;
const char * chars = base32Chars.c_str();
string s(len, '0');
@ -165,6 +167,8 @@ Hash parseHash32(HashType ht, const string & s)
{
Hash hash(ht);
const char * chars = base32Chars.c_str();
for (unsigned int i = 0; i < s.length(); ++i) {
char c = s[i];
unsigned char digit;

View file

@ -15,6 +15,8 @@ const int md5HashSize = 16;
const int sha1HashSize = 20;
const int sha256HashSize = 32;
extern const string base32Chars;
struct Hash
{