Crates.io | custom_user_id |
lib.rs | custom_user_id |
version | 0.0.3 |
source | src |
created_at | 2022-10-15 05:41:51.369088 |
updated_at | 2022-10-15 05:58:01.769717 |
description | Generates a random id with string of your choice appended or prepended to it |
homepage | https://github.com/bocarw121/custom_user_id.git |
repository | https://github.com/bocarw121/custom_user_id.git |
max_upload_size | |
id | 688750 |
size | 4,411 |
Generates a random id with a string of your choice appended or prepended to it. This is useful if you want to track users across multiple devices and platforms. This crate uses uuid under the hood with js enabled so it can be used for WebAssembly.
use custom_user_id::generate_id;
// Set the second argument to true to prepend the id with the given string
generate_id("my_app", true) // my-app-155abb84-81d5-4f36-9220-ef664e785195
// Set second argument to false to append the id with the given string
generate_id("my_app", false) // 7929654a-21a9-4dc5-9ef9-e84a49e393ab-my-app