Module brave

Class HexCodec


  • public final class HexCodec
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long lenientLowerHexToUnsignedLong​(java.lang.CharSequence lowerHex, int index, int endIndex)
      Like lowerHexToUnsignedLong(CharSequence, int), but returns zero on invalid input
      static long lowerHexToUnsignedLong​(java.lang.CharSequence lowerHex)
      Parses a 1 to 32 character lower-hex string with no prefix into an unsigned long, tossing any bits higher than 64.
      static long lowerHexToUnsignedLong​(java.lang.CharSequence lowerHex, int index)
      Parses a 16 character lower-hex string with no prefix into an unsigned long, starting at the specified index.
      static java.lang.String toLowerHex​(long v)
      Inspired by okio.Buffer.writeLong
      static void writeHexLong​(char[] data, int pos, long v)
      Inspired by okio.Buffer.writeLong
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • lowerHexToUnsignedLong

        public static long lowerHexToUnsignedLong​(java.lang.CharSequence lowerHex)
        Parses a 1 to 32 character lower-hex string with no prefix into an unsigned long, tossing any bits higher than 64.
      • lowerHexToUnsignedLong

        public static long lowerHexToUnsignedLong​(java.lang.CharSequence lowerHex,
                                                  int index)
        Parses a 16 character lower-hex string with no prefix into an unsigned long, starting at the specified index.
      • lenientLowerHexToUnsignedLong

        public static long lenientLowerHexToUnsignedLong​(java.lang.CharSequence lowerHex,
                                                         int index,
                                                         int endIndex)
        Like lowerHexToUnsignedLong(CharSequence, int), but returns zero on invalid input
      • toLowerHex

        public static java.lang.String toLowerHex​(long v)
        Inspired by okio.Buffer.writeLong
      • writeHexLong

        public static void writeHexLong​(char[] data,
                                        int pos,
                                        long v)
        Inspired by okio.Buffer.writeLong