uuid-validate
Javascript validator for UUID versions 1 through 5
Last updated a year ago by connor.peet .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install uuid-validate 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.3                                ...           latest (a year ago)

3 Versions

  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 4
This Week 6
This Month 34
Last Day 2
Last Week 22
Last Month 75
Dependencies (0)
None
Dev Dependencies (2)
Dependents (88)

Copyright 2014 - 2016 © taobao.org |