How to make a Type 5 UUID in Java?

前端 未结 2 1872
南方客
南方客 2020-12-30 07:06

In python, to make a Type 5 UUID we can simply do:

import uuid
print uuid.uuid5(uuid.NAMESPACE_URL, \'my string\')

Looking through the java

2条回答
  •  忘掉有多难
    2020-12-30 07:56

    In the case someone else needs a library that generates version 5 UUIDs.

    UUID uuid = UuidCreator.getNameBasedSha1("google.com");
    

    https://github.com/f4b6a3/uuid-creator

提交回复
热议问题