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:
parent
9311ab76a5
commit
b7f008fc35
5 changed files with 52 additions and 31 deletions
|
@ -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;
|
||||
|
|
|
@ -15,6 +15,8 @@ const int md5HashSize = 16;
|
|||
const int sha1HashSize = 20;
|
||||
const int sha256HashSize = 32;
|
||||
|
||||
extern const string base32Chars;
|
||||
|
||||
|
||||
struct Hash
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue