> For the complete documentation index, see [llms.txt](https://malwaresourcecode.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malwaresourcecode.com/home/string-hashing/sdbm.md).

# Sdbm

```cpp
#include <Windows.h>

UINT32 HashStringSdbmW(PWCHAR String)
{
	UINT32 Hash = 0;
	
	while (*String)
	{
		Hash = (UINT32)(*String) + (Hash << 6) + (Hash << 16) - Hash;
		String++;
	}

	return Hash;
}


INT main(VOID)
{
	WCHAR StringHashExample[] = L"Hash This String";
	UINT32 Hash = 0;

	Hash = HashStringSdbmW(StringHashExample);

	return ERROR_SUCCESS;
}
```
