Giter Site home page Giter Site logo

java-multibase's Introduction

java-multibase

A Java implementation of Multibase

Install

Simply clone this repo.

Usage

byte[] data = ...
String encoded = Multibase.encode(Multibase.Base.Base58BTC, data);
byte[] decoded = Multibase.decode(encoded);

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-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.

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

java-multibase's People

Contributors

celeduc avatar dependabot[bot] avatar ianopolous avatar odisseus avatar richardlitt avatar sic2 avatar stebalien avatar tdiesler avatar web-flow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-multibase's Issues

Release multibase to maven central

The build of dependent projects rely on this to be found on central or some other mvn repository. I can provide a PR that would allow to run

mvn release:prepare

I could then use the created tag to deploy it to central. Better still, someone else with appropriate authorization could run

mvn release:perform

Here is the PR: #8

Managing versions of Java multiformats on Maven

Hi,

How often do you update the versions for the Java multiformats on Jitpack?
I am trying to use the latest version of java-multibase for the java-multiaddr, but I am unable to do so.

Alternatively, how can I force java-multiaddr or java-multihash to use my local version of the java-multibase?

Cheers!

Base32, Base64 are not RFC4648 compliance!

According to RFC4648

  • Base 32 Encoding is based on 5-bit group
  • Base 64 Encoding is based on 6-bit group

However, the implementations of Base 32 and Base 64 in this project is as same as Base58, which is not correct.

This is also conflict with the specs stated here multiformats/multibase:

encoding      codes   name
identity      0x00    8-bit binary (encoder and decoder keeps data unmodified)
base1         1       unary tends to be 11111
base2         0       binary has 1 and 0
base8         7       highest char in octal
base10        9       highest char in decimal
base16        F, f    highest char in hex
base32        B, b    rfc4648 - no padding - highest letter
base32pad     C, c    rfc4648 - with padding
base32hex     V, v    rfc4648 - no padding - highest char
base32hexpad  T, t    rfc4648 - with padding
base32z       h       z-base-32 - used by Tahoe-LAFS - highest letter
base58flickr  Z       highest char
base58btc     z       highest char
base64        m       rfc4648 - no padding
base64pad     M       rfc4648 - with padding - MIME encoding
base64url     u       rfc4648 - no padding
base64urlpad  U       rfc4648 - with padding

Add CI and Code Coverage

Should this project, along with java-multiaddr and java-multihash, have CI and Code Coverage? I don't know much about how to do this for java projects. Is it straightforward?

Base58Btc encoded byte array or zeros causes StringIndexOutOfBoundsException

Multibase.decode("z111111111111111111111111111111111");

throws this:

java.lang.StringIndexOutOfBoundsException: String index out of range: 33
	at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:48)
	at java.base/java.lang.String.charAt(String.java:1515)
	at io.ipfs.multibase.Base58.decode(Base58.java:68)
	at io.ipfs.multibase.Multibase.decode(Multibase.java:55)
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.