git-svn-id: svn://db.shs.com.ru/pip@625 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -485,24 +485,24 @@ endforeach()
|
|||||||
# Build Documentation
|
# Build Documentation
|
||||||
#
|
#
|
||||||
|
|
||||||
find_package(Doxygen QUIET)
|
# find_package(Doxygen QUIET)
|
||||||
if(Doxygen_FOUND)
|
# if(Doxygen_FOUND)
|
||||||
message(STATUS "Building with documentation via Doxygen")
|
# message(STATUS "Building with documentation via Doxygen")
|
||||||
|
|
||||||
#set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in)
|
# #set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in)
|
||||||
set(DOXYFILE ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile)
|
# set(DOXYFILE ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile)
|
||||||
#configure_file(${DOXYFILE_IN} ${DOXYFILE} @ONLY)
|
# #configure_file(${DOXYFILE_IN} ${DOXYFILE} @ONLY)
|
||||||
|
|
||||||
add_custom_target(DOC
|
# add_custom_target(DOC
|
||||||
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
|
# COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
COMMENT "Generating API documentation with Doxygen"
|
# COMMENT "Generating API documentation with Doxygen"
|
||||||
VERBATIM)
|
# VERBATIM)
|
||||||
|
|
||||||
add_custom_command(TARGET DOC
|
# add_custom_command(TARGET DOC
|
||||||
POST_BUILD
|
# POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/source/doc/Documentation.html ${CMAKE_SOURCE_DIR}/doc
|
# COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/source/doc/Documentation.html ${CMAKE_SOURCE_DIR}/doc
|
||||||
)
|
# )
|
||||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
|
# install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
|
||||||
endif()
|
# endif()
|
||||||
|
|
||||||
|
|||||||
@@ -155,6 +155,19 @@ PIByteArray PICrypt::hash(const PIString & secret) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
PIByteArray PICrypt::hash(const PIByteArray & data) {
|
||||||
|
PIByteArray hash;
|
||||||
|
#ifdef PIP_CRYPT
|
||||||
|
if (!init()) return hash;
|
||||||
|
hash.resize(crypto_generichash_BYTES);
|
||||||
|
crypto_generichash(hash.data(), hash.size(), data.data(), data.size(), (const uchar*)hash_def_key, sizeof(hash_def_key) - 1);
|
||||||
|
#else
|
||||||
|
PICRYPT_DISABLED_WARNING
|
||||||
|
#endif
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ullong PICrypt::shorthash(const PIString& s, PIByteArray key) {
|
ullong PICrypt::shorthash(const PIString& s, PIByteArray key) {
|
||||||
ullong hash = 0;
|
ullong hash = 0;
|
||||||
#ifdef PIP_CRYPT
|
#ifdef PIP_CRYPT
|
||||||
|
|||||||
@@ -54,6 +54,9 @@ public:
|
|||||||
//! Generate hash from keyphrase "secret", may be used as a key for encryption
|
//! Generate hash from keyphrase "secret", may be used as a key for encryption
|
||||||
static PIByteArray hash(const PIString & secret);
|
static PIByteArray hash(const PIString & secret);
|
||||||
|
|
||||||
|
//! Generate hash from bytearray
|
||||||
|
static PIByteArray hash(const PIByteArray & data);
|
||||||
|
|
||||||
//! Generate short hash from string "s", may be used for hash table
|
//! Generate short hash from string "s", may be used for hash table
|
||||||
static ullong shorthash(const PIString & s, PIByteArray key = PIByteArray());
|
static ullong shorthash(const PIString & s, PIByteArray key = PIByteArray());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user