scala-multibase

Scala Implementation of Multibase.

License

License

MIT
Categories

Categories

Scala Languages
GroupId

GroupId

com.github.fluency03
ArtifactId

ArtifactId

scala-multibase_2.12
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

scala-multibase
Scala Implementation of Multibase.
Project URL

Project URL

https://github.com/fluency03/scala-multibase
Project Organization

Project Organization

fluency03
Source Code Management

Source Code Management

https://github.com/fluency03/scala-multibase

Download scala-multibase_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.fluency03/scala-multibase_2.12/ -->
<dependency>
    <groupId>com.github.fluency03</groupId>
    <artifactId>scala-multibase_2.12</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.fluency03/scala-multibase_2.12/
implementation 'com.github.fluency03:scala-multibase_2.12:0.0.1'
// https://jarcasting.com/artifacts/com.github.fluency03/scala-multibase_2.12/
implementation ("com.github.fluency03:scala-multibase_2.12:0.0.1")
'com.github.fluency03:scala-multibase_2.12:jar:0.0.1'
<dependency org="com.github.fluency03" name="scala-multibase_2.12" rev="0.0.1">
  <artifact name="scala-multibase_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.fluency03', module='scala-multibase_2.12', version='0.0.1')
)
libraryDependencies += "com.github.fluency03" % "scala-multibase_2.12" % "0.0.1"
[com.github.fluency03/scala-multibase_2.12 "0.0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.7
org.scalactic : scalactic_2.12 jar 3.0.5

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.12 jar 3.0.5

Project Modules

There are no modules declared in this project.

scala-multibase

Latest release Maven Central standard-readme compliant

Scala Implementation of Multibase.

Table of Contents

Install

Maven

<dependency>
  <groupId>com.github.fluency03</groupId>
  <artifactId>scala-multibase_2.12</artifactId>
  <version>{latestVersion}</version>
</dependency>

sbt

libraryDependencies += "com.github.fluency03" % "scala-multibase_2.12" % {latestVersion}

Usage

import com.github.fluency03.multibase.Multibase
import com.github.fluency03.multibase.Base._

val str = "Multibase is awesome! \\o/"

Multibase.encodeString(Base32Upper, str)              // BJV2WY5DJMJQXGZJANFZSAYLXMVZW63LFEEQFY3ZP
Multibase.encodeString(Base32Pad, str)                // cjv2wy5djmjqxgzjanfzsaylxmvzw63lfeeqfy3zp
Multibase.encodeString(Base32PadUpper, str)           // CJV2WY5DJMJQXGZJANFZSAYLXMVZW63LFEEQFY3ZP

Multibase.encodeString(Base32Z, str)                  // hji4sa7djcjozg3jypf31yamzci3s65mfrrofa53x
Multibase.encodeString(Base58Flickr, str)             // ZxaJjNnAzU5jHQLhoLrXxcVM66Ca1VkLWAT
Multibase.encodeString(Base58BTC, str)                // zYAjKoNbau5KiqmHPmSxYCvn66dA1vLmwbt

Multibase.encodeString(Base64, str)                   // mTXVsdGliYXNlIGlzIGF3ZXNvbWUhIFxvLw
Multibase.encodeString(Base64Pad, str)                // MTXVsdGliYXNlIGlzIGF3ZXNvbWUhIFxvLw==
Multibase.encodeString(Base64URL, str)                // uTXVsdGliYXNlIGlzIGF3ZXNvbWUhIFxvLw
Multibase.encodeString(Base64URLPad, str)             // UTXVsdGliYXNlIGlzIGF3ZXNvbWUhIFxvLw==


val encodedStr: String = Multibase.encode(Base16, str.getBytes)
// encodedStr: String = f4d756c74696261736520697320617765736f6d6521205c6f2f

val decodedBytes: Array[Byte] = Multibase.decode(encodedStr)
// decodedBytes: Array[Byte] = Array(77, 117, 108, 116, 105, 98, 97, 115, 101, 32, 105, 115, 32, 97, 119, 101, 115, 111, 109, 101, 33, 32, 92, 111, 47)

val decodedStr = new String(decodedBytes)
// decodedStr: String = Multibase is awesome! \o/

API

Maintainers

@fluency03

Contribute

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT © 2018 @fluency03

Versions

Version
0.0.1