Class Longs

java.lang.Object
org.bouncycastle.util.Longs

public class Longs extends Object
Utility methods and constants for longs.
  • Field Details

  • Constructor Details

    • Longs

      public Longs()
  • Method Details

    • bitCount

      public static int bitCount(long i)
    • bitLength

      public static int bitLength(long i)
    • compare

      public static int compare(long x, long y)
    • compareUnsigned

      public static int compareUnsigned(long x, long y)
    • divideUnsigned

      public static long divideUnsigned(long x, long y)
    • highestOneBit

      public static long highestOneBit(long i)
    • lowestOneBit

      public static long lowestOneBit(long i)
    • numberOfLeadingZeros

      public static int numberOfLeadingZeros(long i)
    • numberOfTrailingZeros

      public static int numberOfTrailingZeros(long i)
    • parseUnsignedLong

      public static long parseUnsignedLong(String s)
    • reverse

      public static long reverse(long i)
    • reverseBytes

      public static long reverseBytes(long i)
    • rotateLeft

      public static long rotateLeft(long i, int distance)
    • rotateRight

      public static long rotateRight(long i, int distance)
    • toUnsignedByteArray

      public static byte[] toUnsignedByteArray(long i)
      Return the big-endian encoding of i taken as an unsigned 64-bit value, in the fewest octets that hold its significant bits: 0 is the empty array, 255 is FF, 256 is 01 00, and a negative argument takes all eight.
    • valueOf

      public static Long valueOf(long value)
    • xorTo

      @Deprecated public static void xorTo(int len, long[] x, int xOff, long[] z, int zOff)