authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-12 00:50:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-12 00:50:37-07:00
log8374be1a1c6cba12ec01d7a6301a8da0a00907f4
treefe9540ba9505c75ba59a53021f44434f3c508387
parentc903dad915cd21697692b00c69c8424438d0da15

std.cache_hash: bump up the base64 digest len to avoid '=='


1 files changed, 3 insertions(+), 2 deletions(-)

lib/std/cache_hash.zig+3-2
...@@ -16,8 +16,9 @@ const Allocator = std.mem.Allocator;...@@ -16,8 +16,9 @@ const Allocator = std.mem.Allocator;
1616
17const base64_encoder = fs.base64_encoder;17const base64_encoder = fs.base64_encoder;
18const base64_decoder = fs.base64_decoder;18const base64_decoder = fs.base64_decoder;
19/// This is 128 bits - Even with 2^54 cache entries, the probably of a collision would be under 10^-619/// 16 would be 128 bits - Even with 2^54 cache entries, the probably of a collision would be under 10^-6
20const BIN_DIGEST_LEN = 16;20/// We round up to 18 to avoid the `==` padding after base64 encoding.
21const BIN_DIGEST_LEN = 18;
21const BASE64_DIGEST_LEN = base64.Base64Encoder.calcSize(BIN_DIGEST_LEN);22const BASE64_DIGEST_LEN = base64.Base64Encoder.calcSize(BIN_DIGEST_LEN);
2223
23const MANIFEST_FILE_SIZE_MAX = 50 * 1024 * 1024;24const MANIFEST_FILE_SIZE_MAX = 50 * 1024 * 1024;