targetFromCompact static method

BigInt targetFromCompact(
  1. int compact
)

Compact bits -> target (toy implementation similar to Bitcoin's compact format).

Implementation

static BigInt targetFromCompact(int compact) {
  final size = (compact >> 24) & 0xff;
  final word = compact & 0x007fffff;
  BigInt result = BigInt.from(word) << (8 * (size - 3));
  return result;
}