Skip to content

Instantly share code, notes, and snippets.

@ihoneymon
Created February 10, 2018 15:09
Show Gist options
  • Select an option

  • Save ihoneymon/b0a393558c34365080e7f191ee39f718 to your computer and use it in GitHub Desktop.

Select an option

Save ihoneymon/b0a393558c34365080e7f191ee39f718 to your computer and use it in GitHub Desktop.
아무런 생각없이 사용했던 UUID에는 4가지 형태의 UUID가 있었다.
/**
 * The version number associated with this {@code UUID}.  The version
 * number describes how this {@code UUID} was generated.
 *
 * The version number has the following meaning:
 * <ul>
 * <li>1    Time-based UUID
 * <li>2    DCE security UUID
 * <li>3    Name-based UUID
 * <li>4    Randomly generated UUID
 * </ul>
 *
 * @return  The version number of this {@code UUID}
 */
public int version() {
    // Version is bits masked by 0x000000000000F000 in MS long
    return (int)((mostSigBits >> 12) & 0x0f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment