VirtualBox

Changeset 40052 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Feb 9, 2012 3:36:00 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
76179
Message:

IPRT: Added string hashing API (RTStrHash1*).

Location:
trunk/src/VBox/Runtime
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r40029 r40052  
    386386        common/string/strformatrt.cpp \
    387387        common/string/strformattype.cpp \
     388        common/string/strhash1.cpp \
    388389        common/string/stringalloc.cpp \
    389390        common/string/strprintf.cpp \
     
    14941495        common/misc/term.cpp \
    14951496        common/path/RTPathFilename.cpp \
     1497        common/string/strhash1.cpp \
    14961498        common/string/strncmp.cpp \
    14971499        common/string/strpbrk.cpp \
     
    16591661        common/string/strformatrt.cpp \
    16601662        common/string/strformattype.cpp \
     1663        common/string/strhash1.cpp \
    16611664        common/string/strprintf.cpp \
    16621665        common/string/strtonum.cpp \
  • trunk/src/VBox/Runtime/include/internal/strhash.h

    r36597 r40052  
    7676}
    7777
     78
    7879/**
    7980 * Incremental hashing.
     
    9091}
    9192
     93/**
     94 * Incremental hashing with length limitation.
     95 */
     96DECLINLINE(uint32_t) sdbmIncN(const char *psz, size_t cchMax, uint32_t uHash)
     97{
     98    uint8_t *pu8 = (uint8_t *)psz;
     99    int      c;
     100
     101    while ((c = *pu8++) && cchMax-- > 0)
     102        uHash = c + (uHash << 6) + (uHash << 16) - uHash;
     103
     104    return uHash;
     105}
     106
    92107
    93108#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette