sealed abstract class NumberUtil extends CryptoNumberUtil
Created by chris on 2/8/16.
- Alphabetic
- By Inheritance
- NumberUtil
- CryptoNumberUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- 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 toto
base - def convertBytes[T <: Number[T]](data: ByteVector, from: UInt32, to: UInt32, pad: Boolean, f: (Byte) => T): Try[Vector[T]]
- def convertUInt5sToUInt8(u5s: Vector[UInt5], pad: Boolean = false): Vector[UInt8]
- def convertUInt8sToUInt5s(u8s: Vector[UInt8]): Vector[UInt5]
- 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.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- 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.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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
- See also
- def lexicographicalOrdering[T](implicit ord: Ordering[T]): Ordering[Vector[T]]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def posInt: Int
Generates a random positive integer
- def pow2(exponent: Int): BigInt
Takes 2^^num.
- def randomBytes(num: Int): ByteVector
- 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)
- See also
https://github.com/scala/scala/blob/4aae0b91cd266f02b9f3d911db49381a300b5103/src/library/scala/util/Random.scala#L131
- def search[A, B >: A](seq: IndexedSeq[A], elem: B)(implicit ord: Ordering[B]): Int
- def search[A, B >: A](seq: IndexedSeq[A], elem: B, from: Int, to: Int)(implicit ord: Ordering[B]): Int
- def search[A, B >: A, Wrapper](seq: IndexedSeq[Wrapper], elem: B, unwrap: (Wrapper) => A)(implicit ord: Ordering[B]): Int
- 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
- Annotations
- @tailrec()
- See also
https://github.com/scala/scala/blob/4aae0b91cd266f02b9f3d911db49381a300b5103/src/library/scala/collection/IndexedSeq.scala#L117
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def targetCompression(difficultyHelper: TargetDifficultyHelper): UInt32
- def targetCompression(bigInt: BigInt, isNegative: Boolean): UInt32
- 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
- See also
- 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.
- See also
developer reference for more information Meant to replicate this function in bitcoin core
- 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
- CryptoNumberUtil
- 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
- CryptoNumberUtil
- def toInt(hex: String): Int
Converts a hex string to a Int.
- def toInt(bytes: ByteVector): Int
- def toLong(hex: String): Long
Converts a hex string to a Long.
- def toLong(bytes: ByteVector): Long
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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
- CryptoNumberUtil
- 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
- CryptoNumberUtil
- def uintToFieldElement(bytes: ByteVector): FieldElement
- Definition Classes
- CryptoNumberUtil
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()