|
xrootd
|
A bunch of useful functions. More...
#include <Utils.hh>
Static Public Member Functions | |
| static bool | CRC32TextToInt (uint32_t &result, const std::string &text) |
| static ssize_t | GetRandomBytes (char *buffer, size_t size) |
| static uint32_t | GetInitialCRC32 () |
| Get initial CRC32 value. | |
| static uint32_t | ComputeCRC32 (const void *buffer, uint64_t len) |
| static uint32_t | UpdateCRC32 (uint32_t crc, const void *buffer, uint64_t len) |
| static uint32_t | CombineCRC32 (uint32_t crc1, uint32_t crc2, uint64_t len2) |
A bunch of useful functions.
| static uint32_t XrdClTests::Utils::CombineCRC32 | ( | uint32_t | crc1, |
| uint32_t | crc2, | ||
| uint64_t | len2 | ||
| ) | [inline, static] |
Combine two crc32 checksums
| crc1 | checksum of the first data block |
| crc2 | checksum of the second data block |
| len2 | size of the second data block |
Referenced by ThreadingTest::ReadTestFunc().
| static uint32_t XrdClTests::Utils::ComputeCRC32 | ( | const void * | buffer, |
| uint64_t | len | ||
| ) | [inline, static] |
Compute crc32 checksum out of a buffer
| buffer | data buffer |
| len | size of the data buffer |
References GetInitialCRC32().
Referenced by XrdClTests::ClientHandler::ClientHandler(), FileTest::ReadTest(), ThreadingTest::ReadTestFunc(), runChild(), SocketHandler::UpdateTransferMap(), FileTest::VectorReadTest(), and FileTest::WriteTest().
| bool XrdClTests::Utils::CRC32TextToInt | ( | uint32_t & | result, |
| const std::string & | text | ||
| ) | [static] |
Convert string representation of a crc checksum to int
| result | the resulting integer |
| text | input sting |
References XrdCl::Utils::splitString().
| static uint32_t XrdClTests::Utils::GetInitialCRC32 | ( | ) | [inline, static] |
Get initial CRC32 value.
Referenced by ComputeCRC32(), and ThreadingTest::ReadTestFunc().
| ssize_t XrdClTests::Utils::GetRandomBytes | ( | char * | buffer, |
| size_t | size | ||
| ) | [static] |
Fill the buffer with random data
| buffer | the buffer to be filled |
| size | size of the buffer |
References close(), open(), and read().
Referenced by RandomHandler::HandleConnection(), RandomPumpHandler::HandleConnection(), SocketTest::TransferTest(), and FileTest::WriteTest().
| static uint32_t XrdClTests::Utils::UpdateCRC32 | ( | uint32_t | crc, |
| const void * | buffer, | ||
| uint64_t | len | ||
| ) | [inline, static] |
Update a crc32 checksum
| crc | old checksum |
| buffer | data buffer |
| len | size of the data buffer |
Referenced by DataReader(), XrdClTests::ClientHandler::UpdateReceivedData(), XrdClTests::ClientHandler::UpdateSentData(), SocketHandler::UpdateTransferMap(), and FileTest::WriteTest().
1.7.6.1