Changed namespace usage

New function is hash(hash(ns) + hash(data)) if ns is set and
just hash(data) otherwise