Fix hash.digestForIndex return bug