
com.wavesplatform.common.utils.Base58.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lang Show documentation
Show all versions of lang Show documentation
The RIDE smart contract language compiler
The newest version!
package com.wavesplatform.common.utils
import scala.util.control.NonFatal
object Base58 extends BaseXXEncDec {
private[this] val useSlowBase58: Boolean = sys.props.get("waves.use-slow-base58").exists(s => s.toLowerCase == "true" || s == "1")
override val defaultDecodeLimit: Int = 192
override def encode(array: Array[Byte]): String = {
if (useSlowBase58) {
StdBase58.encode(array)
} else {
try {
FastBase58.encode(array)
} catch {
case NonFatal(_) =>
StdBase58.encode(array)
}
}
}
override def decode(str: String): Array[Byte] = {
if (useSlowBase58) {
StdBase58.decode(str)
} else {
try {
FastBase58.decode(str)
} catch {
case NonFatal(_) =>
StdBase58.decode(str)
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy