From 8f8bc0dcf3bc253ae49159d52db049767f476ced Mon Sep 17 00:00:00 2001 From: Muthu Subramanian <sumuthu@collabora.com> Date: Thu, 13 Feb 2014 13:13:53 +0530 Subject: Move string hash function into String class. hashCode() seems to do sampling while creating the hash. hashCode64() will not. Change-Id: Id30f5a2a774cf5244dbc00da9649e95a532484be --- include/rtl/string.hxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/rtl/string.hxx') diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index fb7283b3a801..24bb98052e40 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -891,6 +891,19 @@ public: return !( literal == rStr ); } + /** + Returns a 64bit hash of the string data. + This hashes the entire data, while hashCode would do sampling for larger string sizes. + + @return a hash code value of the string data + + @see hashCode() for simple hashes + */ + sal_uInt64 hashCode64() const SAL_THROW(()) + { + return rtl_str_hashCode64_WithLength( pData->buffer, pData->length ); + } + /** Returns a hashcode for this string. -- cgit