multiformats/java-multihash


A Java implementation of Multihash

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.multiformats:java-multihash:1.3.4'
	}
	dependencies {
		implementation("com.github.multiformats:java-multihash:1.3.4")
	}
	<dependency>
	    <groupId>com.github.multiformats</groupId>
	    <artifactId>java-multihash</artifactId>
	    <version>1.3.4</version>
	</dependency>

                            
    libraryDependencies += "com.github.multiformats" % "java-multihash" % "1.3.4"
        
        

                            
    :dependencies [[com.github.multiformats/java-multihash "1.3.4"]]
        
        

Readme


java-multihash

Travis CI Release

A Java implementation of multihash.

Install

Simply clone this repository.

Usage

Multihash b58 = Multihash.decode("QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy");
Multihash b36 = Multihash.decode("kmue2y4illvr0m3lt8x6z8iwghtxlzdmkjh957p5rr5cdr9243ugc");

Note that this library only decodes & encodes Multihashes, and does not actually include any implementations of the hash functions themselves.

Consumers of this library can use different implementations for different reasons. Here are a few possible implementation choices for each Multihash.Type:

Please contribute an update to this list if you know of any other related libraries.

Dependency

You can use this project by building the JAR file as specified below, or by using JitPack (also supporting Gradle, SBT, etc).

for Maven, you can add the follwing sections to your POM.XML:

  <repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>com.github.multiformats</groupId>
      <artifactId>java-multihash</artifactId>
      <version>$LATEST_VERSION</version>
    </dependency>
  </dependencies>

Testing

mvn test

Building

mvn package will build a JAR file with Maven dependency information.

Releasing

The version number is specified in the pom.xml file and must be changed in order to be accurately reflected in the JAR file manifest. A git tag must be added in the format "vx.x.x" for JitPack to work.

Maintainers

Captain: @ianopolous.

Contribute

Contributions welcome. Please 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, please conform to the standard-readme specification.

License

MIT © 2015 Ian Preston