A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/multiformats/SwiftMultihash below:

multiformats/SwiftMultihash: Swift implementation of multihash

This project is no longer maintained and has been archived.

Swift implementation of multihash

Add the following to your Cartfile:

github "multihash/SwiftMultihash"

Then, in the root of your project, type: carthage update --platform Mac

If you get the error 'Project "VarInt.xcodeproj" has no shared schemes'

Make sure your scheme is marked shared. For more details see here

You will then need to add frameworks to your own Xcode project:

For more information on how to install via Carthage see the README

import SwiftMultihash 
import SwiftHex

func test() {
    
    if let buffer = SwiftHex.decodeString("0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33") {
        let (multihashBuffer,_) = SwiftMultihash.encodeName(buffer, "sha1")
        if let mhb = multihashBuffer {
            
            var multihashHex = SwiftHex.encodeToString(mhb)
            println("Hex: \(multihashHex)")
    
            let (object, _) = SwiftMultihash.decode(mhb)
            if let obj = object {
                
                multihashHex = SwiftHex.encodeToString(obj.digest)
                println(String(format: "obj: %@ 0x%X %d %@\n", obj.name!, obj.code, obj.length, multihashHex))
            }
        }
    }
}

Captain: @NeoTeo.

Contributions are welcome! Check out the issues.

Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to Multiformats are subject to the IPFS Code of Conduct.

Small note: If editing the README, note that this README should be standard-readme compatible.

MIT © 2015 Matteo Sartori


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4