Exemple #1
0
def make_mutable_url(data_id):
    """
    DHT implementation of the make_mutable_url API call.
    Given the ID of the data, generate a URL that
    can be used to route reads and writes to the data.

    Return a string.  Use dht+udp to convey both the scheme
    and the transport (since it won't be in /etc/services).
    """
    return "dht+udp://" + hex_hash160(data_id)
def make_mutable_url(data_id):
    """
    DHT implementation of the make_mutable_url API call.
    Given the ID of the data, generate a URL that
    can be used to route reads and writes to the data.

    Return a string.  Use dht+udp to convey both the scheme
    and the transport (since it won't be in /etc/services).
    """
    return "dht+udp://" + hex_hash160(data_id)
Exemple #3
0
def hash_name(name, script_pubkey, register_addr=None):
    """
    Generate the hash over a name and hex-string script pubkey
    """
    bin_name = b40_to_bin(name)
    name_and_pubkey = bin_name + unhexlify(script_pubkey)

    if register_addr is not None:
        name_and_pubkey += str(register_addr)

    return hex_hash160(name_and_pubkey)
Exemple #4
0
 def hash_data( d ):
    return hex_hash160( d )
Exemple #5
0
def get_zonefile_data_hash(data_txt):
    """
    Generate a hash over a user's zonefile.
    Return the hex string.
    """
    return hex_hash160(data_txt)
Exemple #6
0
def dht_data_hash(data):
    """
    Calculate a key from the data.
    """
    return hex_hash160(data)
 def hash_data( d ):
    return hex_hash160( d )
def dht_data_hash(data):
    """
    Calculate a key from the data.
    """
    return hex_hash160(data)