'Split an encoded hash and return: (
algorithm, variety, version, time_cost, memory_cost,
parallelism, salt, data,'

def _decode(self, encoded):

    bits = encoded.split('$')
    if (len(bits) == 5):
        (algorithm, variety, raw_params, salt, data) = bits
        version = 16
    else:
        assert (len(bits) == 6)
        (algorithm, variety, raw_version, raw_params, salt, data) = bits
        assert raw_version.startswith('v=')
        version = int(raw_version[len('v='):])
    params = dict((bit.split('=', 1) for bit in raw_params.split(',')))
    assert ((len(params) == 3) and all(((x in params) for x in ('t', 'm', 'p'))))
    time_cost = int(params['t'])
    memory_cost = int(params['m'])
    parallelism = int(params['p'])
    return (algorithm, variety, version, time_cost, memory_cost, parallelism, salt, data)
