1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-25 11:08:02 +02:00

HashEncode64 improvements

This commit is contained in:
Brian Fiete 2021-12-28 12:31:47 -05:00
parent cf40ef26ee
commit cfaeb875f8

View file

@ -4677,12 +4677,13 @@ String BfTypeUtils::HashEncode64(uint64 val)
} }
} }
for (int i = 0; i < 10; i++) while (val > 0)
{ {
int charIdx = (int)((val >> (i * 6)) & 0x3F) - 1; int charIdx = val % 0x3F;
if (charIdx != -1) val /= 0x3F;
outStr.Append(cHash64bToChar[charIdx]); outStr.Append(cHash64bToChar[charIdx]);
} }
return outStr; return outStr;
} }