summaryrefslogtreecommitdiff
path: root/include/rtl/string.h
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@collabora.com>2014-02-13 13:13:53 +0530
committerMuthu Subramanian <sumuthu@collabora.com>2014-02-13 13:13:53 +0530
commit8f8bc0dcf3bc253ae49159d52db049767f476ced (patch)
tree080da7007b55eac85432d41337f6ea2cda629334 /include/rtl/string.h
parent67b1dad8815f697e92258b8c079720f3a7028ea9 (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.h')
-rw-r--r--include/rtl/string.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/rtl/string.h b/include/rtl/string.h
index 32344bfa4413..71e095561a37 100644
--- a/include/rtl/string.h
+++ b/include/rtl/string.h
@@ -277,6 +277,24 @@ SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_hashCode(
SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_str_hashCode_WithLength(
const sal_Char * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
+/** Return a hash code (64bit) for a string.
+
+ It is not allowed to store the hash code persistently, because later
+ versions could return other hash codes.
+
+ @param str
+ a string. Need not be null-terminated, but must be at least as long as
+ the specified len.
+
+ @param len
+ the length of the string.
+
+ @return
+ a hash code for the given string.
+ */
+SAL_DLLPUBLIC sal_uInt64 SAL_CALL rtl_str_hashCode64_WithLength(
+ const sal_Char * str, sal_Int32 len ) SAL_THROW_EXTERN_C();
+
/** Search for the first occurrence of a character within a string.
The string must be null-terminated.