diff options
author | Muthu Subramanian <sumuthu@collabora.com> | 2014-02-13 13:13:53 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@collabora.com> | 2014-02-13 13:13:53 +0530 |
commit | 8f8bc0dcf3bc253ae49159d52db049767f476ced (patch) | |
tree | 080da7007b55eac85432d41337f6ea2cda629334 /include/rtl/string.hxx | |
parent | 67b1dad8815f697e92258b8c079720f3a7028ea9 (diff) |
Move string hash function into String class.
hashCode() seems to do sampling while creating the hash.
hashCode64() will not.
Change-Id: Id30f5a2a774cf5244dbc00da9649e95a532484be
Diffstat (limited to 'include/rtl/string.hxx')
-rw-r--r-- | include/rtl/string.hxx | 13 |
1 files changed, 13 insertions, 0 deletions
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 @@ -892,6 +892,19 @@ public: } /** + 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. @return a hash code value for this object. |