MCPcopy Create free account
hub / github.com/boostorg/build / hash_keyval

Function hash_keyval

src/engine/object.cpp:133–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131
132
133static unsigned int hash_keyval( char const * key, int32_t size )
134{
135 unsigned int const magic = 2147059363;
136 unsigned int hash = 0;
137
138 unsigned int i;
139 for ( i = 0; i < size / sizeof( unsigned int ); ++i )
140 {
141 unsigned int val;
142 memcpy( &val, key, sizeof( unsigned int ) );
143 hash = hash * magic + val;
144 key += sizeof( unsigned int );
145 }
146
147 {
148 unsigned int val = 0;
149 memcpy( &val, key, size % sizeof( unsigned int ) );
150 hash = hash * magic + val;
151 }
152
153 return hash + ( hash >> 17 );
154}
155
156
157static void string_set_init( string_set * set )

Callers 2

string_set_insertFunction · 0.70
object_hashFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected