From 00768c14bacf9a6e37be20863e8f388ccb961b29 Mon Sep 17 00:00:00 2001 From: "Oleg \"OSA413\" Sokolov" Date: Fri, 26 Jul 2024 20:33:51 +0500 Subject: [PATCH] Added description about replacement of this library --- Cargo.toml | 2 +- README.md | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 70811f7..a4c1c27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "uuid-by-string" description = "Generating uuid-hash from string" -version = "2.0.3" +version = "2.0.5" edition = "2021" authors = ["Oleg \"OSA413\" Sokolov", "Danakt Saushkin"] repository = "https://github.com/OSA413/uuid-by-string" diff --git a/README.md b/README.md index 5d291de..9f5f61d 100644 --- a/README.md +++ b/README.md @@ -53,3 +53,24 @@ fn main() { assert_eq!(generate_uuid_with_namespace_v5("hello world", "D3486AE9-136e-5856-bc42-212385ea7970"), Ok("1825ed38-348f-5b46-99de-fd84b83aba5e".to_owned())); } ``` + +## Replacement + +You can (and should) replace this library with https://docs.rs/uuid/. The code whould look like this: + +```rust +let uuid = Uuid::new_v3(&Uuid::nil(), b"Hello world!"); +let uuid = Uuid::new_v5(&Uuid::nil(), b"Hello world!"); +``` + +Since generating a UUID v3 and v5 without namespace is non-standard you either have to stick with this library or rely on your own implementation of the following methods of this library: +``` +generate_uuid +generate_uuid_v3 +generate_uuid_v5 +``` + +More info about replacement: +* https://docs.rs/uuid/ +* https://docs.rs/uuid/latest/uuid/struct.Uuid.html#method.new_v3 +* https://docs.rs/uuid/latest/uuid/struct.Uuid.html#method.new_v5 \ No newline at end of file