@datadayrepos/js-id-web
v0.0.1-beta.1
Published
Utils for generating identifiers in javascript browser environment. Using web crypto engine for random number generation.
Downloads
3
Readme
js-id-web
Utils for generating identifiers in javascript browser environment. Using web crypto engine for random number generation.
🚀 Content
- XIDs: ....
- UID: ....
- Timebased: Timestamo with a twist - increments with an integer if duplicates in the same ms.
- Random: Returns x number of chars based on your input.
- Random Crockford: Returns random nased on Crockford UI sensitive library.
🛠 Usage
pnpm i @datadayrepos/js-id-web
💻 Code
import { UUID } from '@datadayrepos/js-id-web'
const id = UUID()
import { generateXID } from '@datadayrepos/js-id-web'
const xid = await generateXID()
const id = xid.next()
import { genTimeId } from '@datadayrepos/js-id-web'
const id = genTimeId()
import { randomString } from '@datadayrepos/js-id-web'
const id = randomString(12)
import { randomCrockford } from '@datadayrepos/js-id-web'
const id = randomCrockford(12)
🔗 Links
- Repository: GitHub Repository
- Issues: Report Bugs
📄 License
Prop License © 2023 Ivar Strand
www.abyrint.com