Clone of sdhash ( http://roussev.net/sdhash/sdhash.html )