huid
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

HUID

Hash Unique ID

HUID is a basic utility for generating, checking or hashing UUIDs.

Setup

yarn add huid

or

npm install --save huid

Usage

Before you start import the functions from the library

import { create, check, hash } from 'huid'

Basic usage

// Create random UUIDs
const randomUuid = create() // c6a4e73f-e60a-497e-a58b-f6b12c894090

// Create consitent UUIDs
const hashedUuid = hash('Hash') // 684cceb8-0d75-4727-87b8-06e91cd88cb7

// Any string can be passed and will generate consistent values
hash('Hash') === hash('Hash') // true
hash('Hash1') !== hash('Hash2') // true

// Check for valid UUIDs
check('684cceb8-0d75-4727-87b8-06e91cd88cb7') // true
check('c6e60a97e586b12c894090') // false

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i huid

Weekly Downloads

29

Version

1.3.0

License

MIT

Unpacked Size

9.29 kB

Total Files

14

Last publish

Collaborators

  • claudiuandrei