New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

uuidv5

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uuidv5

Generates named version 5 UUIDs

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
976
decreased by-64.65%
Maintainers
1
Weekly downloads
 
Created
Source

UUIDv5

Install

npm install uuidv5

Use

var uuidv5 = require('uuidv5');

If you are unfamiliar with v5 UUIDs, read this. For a deeper look, read RFC 4122.

API

uuidv5(namespace, name, [raw_output])

  • namespace can be 'url', 'dns', 'oid', 'x500', or 'null'. If it's none of those, it must be a UUID to use as a namespace, either in string or Buffer form.
  • name can be a string or Buffer. What it should contain is namespace-dependent.
  • raw_output is an optional flag. If set to true, the UUID will be returned as a Buffer instead of as a string.

uuidv5.uuidToString(uuid)

Takes a Buffer-form uuid and returns it as a string.

uuidv5.uuidFromString(uuidStr)

Takes a UUID as a string (with or without dashes [-]) and returns it as a Buffer.

Examples

var uuidv5 = require('uuidv5');

// Generate a UUID in the default URL namespace
var urlUUID = uuidv5('url', 'http://google.com/page');

// Default DNS namespace
var dnsUUID = uuidv5('dns', 'google.com');

// Create your own namespace
var privns = uuidv5('null', 'my-private-namespace', true); // Buffer form is more efficient
var privUUID = uuidv5(privns, 'some-named-thing');

Keywords

FAQs

Package last updated on 16 Jan 2017

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