Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hat

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hat

generate random IDs and avoid collisions

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
278K
increased by2.22%
Maintainers
1
Weekly downloads
 
Created

What is hat?

The 'hat' npm package is a simple utility for generating unique identifiers (UUIDs). It is lightweight and easy to use, making it suitable for applications that require unique keys or tokens.

What are hat's main functionalities?

Generate a unique identifier

This feature allows you to generate a unique identifier using the 'hat' package. The generated ID is a string of random characters.

const hat = require('hat');
const id = hat();
console.log(id);

Generate a unique identifier with a specific bit length

This feature allows you to generate a unique identifier with a specified bit length. In this example, a 128-bit identifier is generated.

const hat = require('hat');
const id = hat(128);
console.log(id);

Generate a unique identifier with a custom base

This feature allows you to generate a unique identifier with a custom base using a rack. The rack can be used to generate multiple unique identifiers.

const hat = require('hat');
const rack = hat.rack();
const id = rack();
console.log(id);

Other packages similar to hat

Keywords

FAQs

Package last updated on 06 Aug 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc