Skip to content

Commit

Permalink
update :: generateULID 반환 타입 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Umjiseung committed Sep 28, 2024
1 parent 19cd056 commit f9625c6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ public Object generate(SharedSessionContractImplementor sharedSessionContractImp
return generateULID();
}

public static String generateULID() {
public static byte[] generateULID() {
long milliseconds = Instant.now().toEpochMilli();

byte[] bytes = new byte[16];
ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.BIG_ENDIAN);
buffer.putLong(milliseconds);
buffer.putLong(random.nextLong());

return toULIDString(bytes);
return bytes;
}

private static String toULIDString(byte[] bytes) {
Expand Down

0 comments on commit f9625c6

Please sign in to comment.