// Calculate the number of padded Base64 characters required for a known payload byte count. pub fn base64_size(bytes: i64) -> i64 { if bytes<0 { return -1; } ((bytes+2)/3)*4 }