Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We've removed it from the multibase spec: #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 1 addition & 4 deletions src/main/scala/com/github/fluency03/multibase/Base.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ object Base {
*/

case object Identity extends Base("identity", 0x00, "")
case object Base1 extends Base("base1", '1', "1")
case object Base2 extends Base("base2", '0', "01")
case object Base8 extends Base("base8", '7', "01234567")
case object Base10 extends Base("base10", '9', "0123456789")
Expand Down Expand Up @@ -95,7 +94,6 @@ object Base {
*/
lazy val Codes: Map[Char, Base] = Map(
Identity.code -> Identity,
Base1.code -> Base1,
Base2.code -> Base2,
Base8.code -> Base8,
Base10.code -> Base10,
Expand Down Expand Up @@ -123,7 +121,6 @@ object Base {
*/
lazy val Names: Map[String, Base] = Map(
Identity.name -> Identity,
Base1.name -> Base1,
Base2.name -> Base2,
Base8.name -> Base8,
Base10.name -> Base10,
Expand All @@ -149,6 +146,6 @@ object Base {
/**
* Unsupported Base.
*/
lazy val Unsupported: Map[Char, Base] = Map(Base1.code -> Base1)
lazy val Unsupported: Map[Char, Base] = Map()

}
2 changes: 0 additions & 2 deletions src/main/scala/com/github/fluency03/multibase/Multibase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ object Multibase {

def encode(base: Base, data: Array[Byte]): String = base.code + {
base match {
case Base1 => throw new UnsupportedOperationException("Base1 is not supported yet!")
case Identity => IdentityImpl.encode(data)
case Base16 => Base16Impl.encode(data, Base16)
case Base16Upper => Base16Impl.encode(data, Base16Upper)
Expand Down Expand Up @@ -38,7 +37,6 @@ object Multibase {
val rest = data.substring(1)
if (rest.isEmpty) Array[Byte]()
else base match {
case Base1 => throw new UnsupportedOperationException("Base1 is not supported yet!")
case Identity => IdentityImpl.decode(rest)
case Base16 => Base16Impl.decode(rest, Base16)
case Base16Upper => Base16Impl.decode(rest, Base16Upper)
Expand Down