Package com.google.gerrit.server.util
Class IdGenerator
- java.lang.Object
-
- com.google.gerrit.server.util.IdGenerator
-
public class IdGenerator extends Object
Simple class to produce 4 billion keys randomly distributed.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
format(int id)
Format an id created by this class as a hex string.static int
mix(int salt, int in)
A very simple bit permutation to mask a simple incrementer.int
next()
Produce the next identifier.
-
-
-
Method Detail
-
format
public static String format(int id)
Format an id created by this class as a hex string.
-
next
public int next()
Produce the next identifier.
-
mix
public static int mix(int salt, int in)
A very simple bit permutation to mask a simple incrementer.
-
-