Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Mitra Ardron
    @mitra42
    Lets get this started ...
    Kyle Drake
    @kyledrake
    You still downstairs?
    Mitra Ardron
    @mitra42
    No - I'm home, wish I'd known you were coming, could have waited.
    I've been meaning to give you a call - lets talk tomorrow.
    Kyle Drake
    @kyledrake
    Ok!
    Mitra Ardron
    @mitra42
    Kyle - is there a number I can call you on, maybe at 2:30 (I’ve got meetings and driving mostly from now till then) my number is +1(510)423-1767
    Mitra Ardron
    @mitra42
    I’ve created a repo for this, its on my account for now, and will move to the ArchiveLabs directory when we figure out why the ArchiveLabs repo is blocking uploads from SourceTree.
    https://github.com/mitra42/dweb_gateway
    Mitra Ardron
    @mitra42
    The repository issues have been sorted out (it was setup to Block 3rd party apps). and its now at https://github.com/ArchiveLabs/dweb_gateway
    Mitra Ardron
    @mitra42
    If anyone sends me their Git account name I can add them to the repository.
    Dr. Neal Krawetz
    @hackerfactor_twitter
    I'm "hackerfactor" on git.
    Mitra Ardron
    @mitra42
    OK - you should have write access
    Kyle Drake
    @kyledrake
    [elem.encode('hex') for elem in 'SHAHASHGOESHERE']
    Mitra Ardron
    @mitra42
    02efe2abec13a309916c6860de5ad8a8a096fe5d
    Kyle Drake
    @kyledrake

    import multihash
    import base58

    sha1_hash = '02efe2abec13a309916c6860de5ad8a8a096fe5d'
    sha1_binary_hash = sha1_hash.decode('hex')

    multihash_binary = multihash.encode(sha1_binary_hash, 0x11)
    multihash_base58 = base58.b58encode(bytes(multihash_binary))
    print(multihash_base58)

    Mitra Ardron
    @mitra42
    That code by the way is wrong, it applies another sha1 hash to something already hashed. Instead of teh multi hash_encode line, it needs:
    multihash_binary = bytearray([SHA1, len(sha1_binary)])
    multihash_binary.extend(sha1_binary)
    Mitra Ardron
    @mitra42
    Oh - and the version of multihash in pip has obvious bugs :-(
    By the way … I’m narrowing in on a solution, but its non-trivial given the lack of any working multihash in either pip or pip3 as far as I can tell.