Object

com.alexdupre.litecoin

Base58Check

Related Doc: package litecoin

Permalink

object Base58Check

https://en.bitcoin.it/wiki/Base58Check_encoding Base58Check is a format based on Base58 and used a lot in litecoin, for encoding addresses and private keys for example. It includes a prefix (usually a single byte) and a checksum so you know what has been encoded, and that it has been transmitted correctly. For example, to create an address for a public key you could write:

val pub: BinaryData = "0202a406624211f2abbdc68da3df929f938c3399dd79fac1b51b0e4ad1d26a47aa"
val address = Base58Check.encode(Base58.Prefix.PubkeyAddress, Crypto.hash160(pub))

And to decode a private key you could write:

// check that is it a mainnet private key
val (Base58.Prefix.SecretKey, priv) = Base58Check.decode("5J3mBbAH58CpQ3Y5RNJpUKPE62SQ5tfcvU2JpbnkeyhfsYB1Jcn")
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Base58Check
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def checksum(data: Seq[Byte]): Seq[Byte]

    Permalink
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def decode(encoded: String): (Byte, BinaryData)

    Permalink

    Decodes Base58 data that has been encoded with a single byte prefix

    Decodes Base58 data that has been encoded with a single byte prefix

    NB: requirement check will throw an IllegalArgumentException if the checksum that is part of the encoded data cannot be verified

    encoded

    encoded data

    returns

    a (prefix, data) tuple

  8. def decodeWithIntPrefix(encoded: String): (Int, BinaryData)

    Permalink

    Decodes Base58 data that has been encoded with an integer prefix

    Decodes Base58 data that has been encoded with an integer prefix

    NB: requirement check will throw an IllegalArgumentException if the checksum that is part of the encoded data cannot be verified

    encoded

    encoded data

    returns

    a (prefix, data) tuple

  9. def decodeWithPrefixLen(encoded: String, prefixLen: Int): (Seq[Byte], BinaryData)

    Permalink

    Decodes Base58 data that has been encoded with several bytes prefix

    Decodes Base58 data that has been encoded with several bytes prefix

    NB: requirement check will throw an IllegalArgumentException if the checksum that is part of the encoded data cannot be verified

    encoded

    encoded data

    returns

    a (prefix, data) tuple

  10. def encode(prefix: Seq[Byte], data: Seq[Byte]): String

    Permalink

    prefix

    version prefix (several bytes, as used with BIP32 ExtendedKeys for example)

    data

    data to be encoded

    returns

    a Base58 String

  11. def encode(prefix: Int, data: Seq[Byte]): String

    Permalink

    prefix

    version prefix (integer, as used with BIP32 ExtendedKeys for example)

    data

    data to be encoded

    returns

    a Base58 String

  12. def encode(prefix: Byte, data: Seq[Byte]): String

    Permalink

    Encode data in Base58Check format.

    Encode data in Base58Check format. For example, to create an address from a public key you could use:

    prefix

    version prefix (one byte)

    data

    date to be encoded

    returns

    a Base58 string

  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped