Comparing version 1.2.13-experimental to 1.2.14-experimental
@@ -74,4 +74,25 @@ 'use strict'; | ||
/** | ||
* @name shortID | ||
* @summary generate a random id composed of alphanumeric characters | ||
* @see https://en.wikipedia.org/wiki/Base36 | ||
* @return {string} random string id | ||
*/ | ||
static shortID() { | ||
return (Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)).toString(36); | ||
} | ||
/** | ||
* @name isUUID4 | ||
* @summary determine whether a string is a valid UUID | ||
* @param {string} str - possible UUID | ||
* @return {undefined} | ||
*/ | ||
static isUUID4(str) { | ||
const uuidPattern = '^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$'; | ||
return (new RegExp(uuidPattern)).test(str); | ||
} | ||
} | ||
module.exports = Utils; |
{ | ||
"name": "hydra", | ||
"version": "1.2.13-experimental", | ||
"version": "1.2.14-experimental", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Carlos Justiniano", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
237567
3319