Socket
Socket
Sign inDemoInstall

uuid-validate

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    uuid-validate

Javascript validator for UUID versions 1 through 5


Version published
Weekly downloads
108K
decreased by-1.11%
Maintainers
1
Install size
7.64 kB
Created
Weekly downloads
 

Readme

Source

uuid-validator

Build Status

Useful little package to validate UUIDs in Node.js. Usage:

var validate = require('uuid-validate');

// Let's validate a uuid version 1. If we don't pass a version, it'll
// infer it based on the uuid itself.
validate('95ecc380-afe9-11e4-9b6c-751b66dd541e'); // => true

// We can tell it what version to expect, and if it gets the wrong
// version, it'll return false.
validate('95ecc380-afe9-11e4-9b6c-751b66dd541e', 1); // => true (it's version 1)
validate('95ecc380-afe9-11e4-9b6c-751b66dd541e', 4); // => false (it's not version 4)

// You can also pass buffers instead of strings.
// This works for UUID versions 1 through 4

// If you want to find out what version a UUID is:
validate.version('95ecc380-afe9-11e4-9b6c-751b66dd541e'); // => 1

Keywords

FAQs

Last updated on 26 May 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc