proper way to calculate toHash() for string

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 30 12:36:23 PDT 2015


On 30/06/15 16:19, aki wrote:

> Please suggest me if anyone have an idea.

You can use TypeInfo.getHash [1] to get the hash of a given value. 
Something like:

string a = "foo";
typeid(a).getHash(&a)

[1] http://dlang.org/phobos/object.html#.TypeInfo.getHash

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list