#id #user-id #generate

no-std custom_user_id

Generates a random id with string of your choice appended or prepended to it

1 unstable release

0.0.3 Oct 15, 2022
0.0.2 Oct 15, 2022
0.0.1 Oct 15, 2022

#1014 in WebAssembly

MIT license

4KB

custom_user_id

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.

Usage

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

Dependencies

~1.3–2.2MB
~41K SLoC