<p>How can a <code>sdbm</code> hash function (such as <a href="http://www.cse.yorku.ca/~oz/hash.html" rel="nofollow noreferrer">this</a>) be implemented in C# ?</p>

You can take the C code almost without changes:
```
```
uint sdbm( string str )
{
    uint hash = 0;
    foreach( char ch in str )
    {
        hash = ch + (hash << 6) + (hash << 16) - hash;
    }
    return hash;
}
```
```
Or did you think of something more sophisticated?