object NumberUtil extends NumberUtil

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NumberUtil
  2. NumberUtil
  3. BitcoinSLogger
  4. Logging
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def convert[To <: Number[To]](data: Vector[UInt8], from: UInt32, to: UInt32, pad: Boolean, f: (UInt8) => To): Try[Vector[To]]

    Converts a sequence uint8 from base to to base

    Converts a sequence uint8 from base to to base

    Definition Classes
    NumberUtil
  7. def convertBytes[T <: Number[T]](data: ByteVector, from: UInt32, to: UInt32, pad: Boolean, f: (Byte) => T): Try[Vector[T]]
    Definition Classes
    NumberUtil
  8. def convertUInt5sToUInt8(u5s: Vector[UInt5], pad: Boolean = false): Vector[UInt8]
    Definition Classes
    NumberUtil
  9. def convertUInt8sToUInt5s(u8s: Vector[UInt8]): Vector[UInt5]
    Definition Classes
    NumberUtil
  10. def debug(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  11. def debug(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  12. def debug(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  13. def decompose(num: Long, base: Int, numDigits: Int): Vector[Int]

    Decomposes the input num into a list of numDigits digits in the given base.

    Decomposes the input num into a list of numDigits digits in the given base. The output Vector has the most significant digit first and the 1's place last.

    Definition Classes
    NumberUtil
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  16. def error(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  17. def error(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  18. def error(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  19. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  20. def fromDigits(digits: Vector[Int], base: Int, numDigits: Int): Long

    Recomposes the input digits into the number they represent.

    Recomposes the input digits into the number they represent. The input Vector has the most significant digit first and the 1's place last.

    Definition Classes
    NumberUtil
  21. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def info(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  24. def info(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  25. def info(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  26. def isDebugEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  27. def isErrorEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  28. def isInfoEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  29. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  30. def isNBitsOverflow(nBits: UInt32): Boolean

    Implements this check for overflowing for org.bitcoins.core.protocol.blockchain.BlockHeader.nBits

    Implements this check for overflowing for org.bitcoins.core.protocol.blockchain.BlockHeader.nBits

    Definition Classes
    NumberUtil
    See also

    bitcoin core check

  31. def isTraceEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  32. def isWarnEnabled: Boolean
    Attributes
    protected
    Definition Classes
    Logging
  33. def lexicographicalOrdering[T](implicit ord: Ordering[T]): Ordering[Vector[T]]
    Definition Classes
    NumberUtil
  34. def logger: Logger
    Attributes
    protected
    Definition Classes
    Logging
  35. def loggerName: String
    Attributes
    protected
    Definition Classes
    Logging
  36. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  37. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  38. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  39. def posInt: Int

    Generates a random positive integer

    Generates a random positive integer

    Definition Classes
    NumberUtil
  40. def pow2(exponent: Int): BigInt

    Takes 2^^num.

    Takes 2^^num.

    Definition Classes
    NumberUtil
  41. def randomBytes(num: Int): ByteVector
    Definition Classes
    NumberUtil
  42. def randomLong(bound: Long): Long

    Returns a pseudorandom, uniformly distributed long value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.

    Returns a pseudorandom, uniformly distributed long value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.

    Stolen from scala.util.Random.nextLong (in scala version 2.13)

    Definition Classes
    NumberUtil
    See also

    https://github.com/scala/scala/blob/4aae0b91cd266f02b9f3d911db49381a300b5103/src/library/scala/util/Random.scala#L131

  43. def search[A, B >: A](seq: IndexedSeq[A], elem: B)(implicit ord: Ordering[B]): Int
    Definition Classes
    NumberUtil
  44. def search[A, B >: A](seq: IndexedSeq[A], elem: B, from: Int, to: Int)(implicit ord: Ordering[B]): Int
    Definition Classes
    NumberUtil
  45. def search[A, B >: A, Wrapper](seq: IndexedSeq[Wrapper], elem: B, unwrap: (Wrapper) => A)(implicit ord: Ordering[B]): Int
    Definition Classes
    NumberUtil
  46. final def search[A, B >: A, Wrapper](seq: IndexedSeq[Wrapper], elem: B, from: Int, to: Int, unwrap: (Wrapper) => A)(implicit ord: Ordering[B]): Int

    Stolen from Scala 2.13 IndexedSeq::binarySearch

    Stolen from Scala 2.13 IndexedSeq::binarySearch

    Definition Classes
    NumberUtil
    Annotations
    @tailrec()
    See also

    https://github.com/scala/scala/blob/4aae0b91cd266f02b9f3d911db49381a300b5103/src/library/scala/collection/IndexedSeq.scala#L117

  47. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  48. def targetCompression(difficultyHelper: TargetDifficultyHelper): UInt32
    Definition Classes
    NumberUtil
  49. def targetCompression(bigInt: BigInt, isNegative: Boolean): UInt32
    Definition Classes
    NumberUtil
  50. def targetCompression(bigInteger: BigInteger, isNegative: Boolean): UInt32

    Compressed the big integer to be used inside of org.bitcoins.core.protocol.blockchain.BlockHeader.nBits

    Compressed the big integer to be used inside of org.bitcoins.core.protocol.blockchain.BlockHeader.nBits

    Definition Classes
    NumberUtil
    See also

    bitcoin core implementation

  51. def targetExpansion(nBits: UInt32): TargetDifficultyHelper

    Expands the nBits field given in a block header to the _actual_ target difficulty.

    Expands the nBits field given in a block header to the _actual_ target difficulty.

    Definition Classes
    NumberUtil
    See also

    developer reference for more information Meant to replicate this function in bitcoin core

    https://github.com/bitcoin/bitcoin/blob/2068f089c8b7b90eb4557d3f67ea0f0ed2059a23/src/arith_uint256.cpp#L206

  52. def toBigInt(bytes: ByteVector): BigInt

    Converts a sequence of bytes to twos complement signed number.

    Converts a sequence of bytes to twos complement signed number.

    Definition Classes
    NumberUtil
  53. def toBigInt(hex: String): BigInt

    Takes a hex string and parses it to a BigInt.

    Takes a hex string and parses it to a BigInt.

    Definition Classes
    NumberUtil
  54. def toInt(hex: String): Int

    Converts a hex string to a Int.

    Converts a hex string to a Int.

    Definition Classes
    NumberUtil
  55. def toInt(bytes: ByteVector): Int

    Converts a sequence of Byte to a Int.

    Converts a sequence of Byte to a Int.

    Definition Classes
    NumberUtil
  56. def toLong(hex: String): Long

    Converts a hex string to a Long.

    Converts a hex string to a Long.

    Definition Classes
    NumberUtil
  57. def toLong(bytes: ByteVector): Long

    Converts a sequence of Byte to a Long.

    Converts a sequence of Byte to a Long.

    Definition Classes
    NumberUtil
  58. def toString(): String
    Definition Classes
    AnyRef → Any
  59. def toUnsignedInt(bytes: Array[Byte]): BigInt

    Converts a sequence of bytes to a **big endian** unsigned integer

    Converts a sequence of bytes to a **big endian** unsigned integer

    Definition Classes
    NumberUtil
  60. def toUnsignedInt(bytes: ByteVector): BigInt

    Converts a sequence of bytes to a **big endian** unsigned integer

    Converts a sequence of bytes to a **big endian** unsigned integer

    Definition Classes
    NumberUtil
  61. def trace(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  62. def trace(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  63. def trace(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging
  64. def uintToFieldElement(bytes: ByteVector): FieldElement
    Definition Classes
    NumberUtil
  65. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  66. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  67. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  68. def warn(mkr: Marker, msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  69. def warn(msg: => Any, t: => Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  70. def warn(msg: => Any): Unit
    Attributes
    protected
    Definition Classes
    Logging

Inherited from NumberUtil

Inherited from BitcoinSLogger

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped