ClickHouse/dbms/Core/tests/string_ref_hash.cpp

23 lines
468 B
C++
Raw Normal View History

#include <IO/ReadBufferFromFileDescriptor.h>
#include <IO/WriteBufferFromFileDescriptor.h>
#include <IO/Operators.h>
#include <common/StringRef.h>
2016-08-06 22:33:20 +00:00
/** Calculates StringRefHash from stdin. For debugging.
*/
2017-12-01 18:36:55 +00:00
int main(int, char **)
2016-08-06 22:33:20 +00:00
{
using namespace DB;
2016-08-06 22:33:20 +00:00
ReadBufferFromFileDescriptor in(STDIN_FILENO);
WriteBufferFromFileDescriptor out(STDOUT_FILENO);
2016-08-06 22:33:20 +00:00
String s;
readStringUntilEOF(s, in);
out << StringRefHash()(s) << '\n';
2016-08-06 22:33:20 +00:00
return 0;
2016-08-06 22:33:20 +00:00
}