Class ByteExtensions


  • public final class ByteExtensions
    extends Object
    • Constructor Detail

      • ByteExtensions

        public ByteExtensions()
    • Method Detail

      • or

        public static byte[] or​(byte[] self,
                                byte[] other)
      • or

        public static byte[] or​(byte[] self,
                                byte[] other,
                                int offset)
      • xor

        public static byte[] xor​(byte[] self,
                                 byte[] other)
      • zero

        public static void zero​(byte[] self)
      • sequenceEqualConstantTime

        public static boolean sequenceEqualConstantTime​(byte[] self,
                                                        byte[] other)
        Compares two byte arrays in constant time.
        Parameters:
        self - The first byte array to compare
        other - The second byte array to compare
        Returns:
        True if the two byte arrays are equal.
      • clone

        public static byte[] clone​(byte[] source)
        Creates a copy of the source array.
        Parameters:
        source - Array to make copy of
        Returns:
        A copy of the array, or null if source was null.