Lines Matching refs:length
56 PHPAPI unsigned char *php_base64_encode(const unsigned char *str, int length, int *ret_length) /* {… in php_base64_encode() argument
62 if (length < 0) { in php_base64_encode()
69 result = (unsigned char *) safe_emalloc((length + 2) / 3, 4 * sizeof(char), 1); in php_base64_encode()
72 while (length > 2) { /* keep going until we have less than 24 bits */ in php_base64_encode()
79 length -= 3; /* we just handle 3 octets of data */ in php_base64_encode()
83 if (length != 0) { in php_base64_encode()
85 if (length > 1) { in php_base64_encode()
137 PHPAPI unsigned char *php_base64_decode(const unsigned char *str, int length, int *ret_length) /* {… in php_base64_decode() argument
139 return php_base64_decode_ex(str, length, ret_length, 0); in php_base64_decode()
143 PHPAPI unsigned char *php_base64_decode_ex(const unsigned char *str, int length, int *ret_length, z… in php_base64_decode_ex() argument
150 result = (unsigned char *)safe_emalloc(length, 1, 1); in php_base64_decode_ex()
153 while ((ch = *current++) != '\0' && length-- > 0) { in php_base64_decode_ex()
155 if (*current != '=' && ((i % 4) == 1 || (strict && length > 0))) { in php_base64_decode_ex()