Tabnine Logo
ULID.internalParseCrockford
Code IndexAdd Tabnine to your IDE (free)

How to use
internalParseCrockford
method
in
de.huxhorn.sulky.ulid.ULID

Best Java code snippets using de.huxhorn.sulky.ulid.ULID.internalParseCrockford (Showing top 2 results out of 315)

origin: de.huxhorn.sulky/de.huxhorn.sulky.ulid

public static Value parseULID(String ulidString)
{
  Objects.requireNonNull(ulidString, "ulidString must not be null!");
  if(ulidString.length() != 26)
  {
    throw new IllegalArgumentException("ulidString must be exactly 26 chars long.");
  }
  String timeString = ulidString.substring(0, 10);
  long time = internalParseCrockford(timeString);
  if ((time & TIMESTAMP_OVERFLOW_MASK) != 0)
  {
    throw new IllegalArgumentException("ulidString must not exceed '7ZZZZZZZZZZZZZZZZZZZZZZZZZ'!");
  }
  String part1String = ulidString.substring(10, 18);
  String part2String = ulidString.substring(18);
  long part1 = internalParseCrockford(part1String);
  long part2 = internalParseCrockford(part2String);
  long most = (time << 16) | (part1 >>> 24);
  long least = part2 | (part1 << 40);
  return new Value(most, least);
}
origin: huxi/sulky

public static Value parseULID(String ulidString)
{
  Objects.requireNonNull(ulidString, "ulidString must not be null!");
  if(ulidString.length() != 26)
  {
    throw new IllegalArgumentException("ulidString must be exactly 26 chars long.");
  }
  String timeString = ulidString.substring(0, 10);
  long time = internalParseCrockford(timeString);
  if ((time & TIMESTAMP_OVERFLOW_MASK) != 0)
  {
    throw new IllegalArgumentException("ulidString must not exceed '7ZZZZZZZZZZZZZZZZZZZZZZZZZ'!");
  }
  String part1String = ulidString.substring(10, 18);
  String part2String = ulidString.substring(18);
  long part1 = internalParseCrockford(part1String);
  long part2 = internalParseCrockford(part2String);
  long most = (time << 16) | (part1 >>> 24);
  long least = part2 | (part1 << 40);
  return new Value(most, least);
}
de.huxhorn.sulky.ulidULIDinternalParseCrockford

Popular methods of ULID

  • nextULID
  • checkTimestamp
  • internalAppendCrockford
  • internalAppendULID
  • internalNextValue
  • internalUIDString
  • internalWriteCrockford
  • nextMonotonicValue
    Returns the next monotonic value. If an overflow happened while incrementing the random part of the
  • nextStrictlyMonotonicValue
    Returns the next monotonic value or empty if an overflow happened while incrementing the random part
  • nextValue

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • onRequestPermissionsResult (Fragment)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • JTable (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now