We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8bc265 commit 6099009Copy full SHA for 6099009
contrib/pgcrypto/encode.c
@@ -26,7 +26,7 @@
26
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
* SUCH DAMAGE.
28
*
29
- * $Id: encode.c,v 1.4.2.1 2001/05/13 03:27:49 momjian Exp $
+ * $Id: encode.c,v 1.4.2.2 2001/05/15 04:45:35 momjian Exp $
30
*/
31
32
#include "postgres.h"
@@ -349,7 +349,8 @@ hex_dec_len(uint srclen)
349
uint
350
b64_enc_len(uint srclen)
351
{
352
- return srclen + (srclen + 2 / 3) + (srclen / (76 / 2)) + 2;
+ /* 3 bytes will be converted to 4, linefeed after 76 chars */
353
+ return (srclen + 2) * 4 / 3 + srclen / (76 * 3 / 4);
354
}
355
356
0 commit comments