Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.class

target/**
build/**
dist/**
.idea/**
Expand Down
64 changes: 61 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# java-multibase
A Java implementation of Multibase

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)
[![](https://img.shields.io/badge/project-multiformats-blue.svg?style=flat-square)](http://github.com/multiformats/multiformats)
[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)

A Java implementation of [Multibase](https://github.com/multiformats/multibase)

## Usage
```java
Expand All @@ -8,5 +13,58 @@ String encoded = Multibase.encode(Multibase.Base.Base58BTC, data);
byte[] decoded = Multibase.decode(encoded);
```

## Compilation
To compile just run ant.
## Dependency
You can use this project by building the JAR file as specified below, or by using [JitPack](https://jitpack.io/#multiformats/java-multibase/) (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-multibase</artifactId>
<version>v1.0.0</version>
</dependency>
</dependencies>
```

## Testing

### Ant
`ant test`

### Maven
`mvn test`

## Building

### Ant
`ant dist` will build a JAR file in the `./dist` suitable for manual inclusion in a project. Dependent libraries are included in `./dist/lib`.

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

## Releasing
The version number is specified in `build.xml` and `pom.xml` and must be changed in both places 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](https://github.com/ianopolous).

## Contribute

Contributions welcome. Please check out [the issues](https://github.com/multiformats/java-multibase/issues).

Check out our [contributing document](https://github.com/multiformats/multiformats/blob/master/contributing.md) 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](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

Small note: If editing the Readme, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.

## License

[MIT](LICENSE) © Ian Preston
17 changes: 8 additions & 9 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<target name="compile" depends="init" description="compile the source">
<javac includeantruntime="false" srcdir="${src}" destdir="${build}" debug="true" debuglevel="lines,vars,source">
<classpath>
<fileset dir="lib">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</classpath>
Expand All @@ -37,28 +37,27 @@
</manifestclasspath>
<jar jarfile="${dist}/multibase.jar" basedir="${build}">
<manifest>
<attribute name="Class-Path" value="${manifest_cp}"/>
<attribute name="Class-Path" value="${manifest_cp}"/>
<attribute name="Implementation-Vendor" value="io.ipfs"/>
<attribute name="Implementation-Title" value="multibase"/>
<attribute name="Implementation-Version" value="1.0.0"/>
</manifest>
</jar>
<copy todir=".">
<fileset file="${dist}/multibase.jar"/>
</copy>
</target>


<target name="test" depends="compile,dist">
<junit printsummary="yes" fork="true" haltonfailure="yes">
<jvmarg value="-Xmx1g"/>
<classpath>
<pathelement location="lib/junit-4.11.jar" />
<pathelement location="lib/hamcrest-core-1.3.jar" />
<pathelement location="multibase.jar" />
<pathelement location="dist/multibase.jar" />
</classpath>
<test name="io.ipfs.api.MultibaseTests" haltonfailure="yes">
<test name="io.ipfs.multibase.MultibaseTest" haltonfailure="yes">
<formatter type="plain"/>
<formatter type="xml"/>
</test>
</junit>
</junit>
</target>

<target name="clean" description="clean up">
Expand Down
84 changes: 84 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.ipfs</groupId>
<artifactId>multibase</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<name>multibase</name>
<url>https://github.com/multiformats/java-multibase</url>

<issueManagement>
<url>https://github.com/multiformats/java-multibase/issues</url>
<system>GitHub Issues</system>
</issueManagement>

<scm>
<url>https://github.com/multiformats/java-multibase</url>
<connection>scm:git:git://github.com/multiformats/java-multibase.git</connection>
<developerConnection>scm:git:git@github.com:multiformats/java-multibase.git</developerConnection>
</scm>

<licenses>
<license>
<name>MIT License</name>
<url>https://github.com/multiformats/java-multiaddr/blob/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<junit.version>4.12</junit.version>
<hamcrest.version>1.3</hamcrest.version>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import java.util.*;

public class MultibaseTests {
public class MultibaseTest {

@Test
public void base58Test() {
Expand Down