[uuid] diegotorres/dtorres.py@gmail.com Improvements for UUIDv5 generation (#10978)

* [uuid] Added method to generate UUID identifiers for version 5

Signed-off-by: Diego Torres <dtorres.py@gmail.com>

* [uuid] Small improvements for UUIDv5 generation

Signed-off-by: Diego Torres <dtorres.py@gmail.com>
This commit is contained in:
Diego Torres
2021-06-29 04:46:32 -04:00
committed by GitHub
parent f440eba4b7
commit c9882f2090
2 changed files with 8 additions and 15 deletions

View File

@@ -63,11 +63,11 @@ class UUIDGeneratorUnitTest {
}
@Test
public void version_5_UUID_is_correctly_generated_for_domain_baeldung_com_without_namespace() throws UnsupportedEncodingException {
public void version_5_UUID_is_correctly_generated_for_domain_baeldung_name() {
UUID uuid = UUIDGenerator.generateType5UUID("baeldung.com");
assertEquals("a3c27ab0-2b46-55ef-b50e-0e5c57bfea94", uuid.toString());
assertEquals("efd5462b-b07a-52a3-94ea-bf575c0e0e75", uuid.toString());
assertEquals(5, uuid.version());
assertEquals(2, uuid.variant());
}