*md5str = '\0';
}
-/* {{{ proto string md5(string str, [ bool raw_output])
+/* {{{ proto string md5(string str, [ bool raw_output]) U
Calculate the md5 hash of a string */
PHP_NAMED_FUNCTION(php_if_md5)
{
PHP_MD5_CTX context;
unsigned char digest[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
RETURN_STRINGL((char*)digest, 16, 1);
} else {
make_digest(md5str, digest);
- RETVAL_ASCII_STRING(md5str, 1);
+ RETVAL_ASCII_STRING(md5str, ZSTR_DUPLICATE);
}
}
/* }}} */
-/* {{{ proto string md5_file(string filename [, bool raw_output])
+/* {{{ proto string md5_file(string filename [, bool raw_output]) U
Calculate the md5 hash of given filename */
PHP_NAMED_FUNCTION(php_if_md5_file)
{
int n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
RETURN_STRINGL((char*)digest, 16, 1);
} else {
make_digest(md5str, digest);
- RETVAL_ASCII_STRING(md5str, 1);
+ RETVAL_ASCII_STRING(md5str, ZSTR_DUPLICATE);
}
}
/* }}} */
*sha1str = '\0';
}
-/* {{{ proto string sha1(string str [, bool raw_output])
+/* {{{ proto string sha1(string str [, bool raw_output]) U
Calculate the sha1 hash of a string */
PHP_FUNCTION(sha1)
{
PHP_SHA1_CTX context;
unsigned char digest[20];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
RETURN_STRINGL((char*)digest, 20, 1);
} else {
make_sha1_digest(sha1str, digest);
- RETVAL_ASCII_STRING(sha1str, 1);
+ RETVAL_ASCII_STRING(sha1str, ZSTR_DUPLICATE);
}
}
/* }}} */
-/* {{{ proto string sha1_file(string filename [, bool raw_output])
+/* {{{ proto string sha1_file(string filename [, bool raw_output]) U
Calculate the sha1 hash of given filename */
PHP_FUNCTION(sha1_file)
{
int n;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &arg, &arg_len, &raw_output) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|b", &arg, &arg_len, &raw_output) == FAILURE) {
return;
}
RETURN_STRINGL((char*)digest, 20, 1);
} else {
make_sha1_digest(sha1str, digest);
- RETVAL_ASCII_STRING(sha1str, 1);
+ RETVAL_ASCII_STRING(sha1str, ZSTR_DUPLICATE);
}
}
/* }}} */