Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
UUID.js - The RFC-compliant UUID generator for JavaScript.
var uuid = UUID.generate();
UUID.js library generates an RFC 4122 compliant Universally Unique IDentifier (UUID).
Math.random()
implementation of WebKit-based browsers when generating a large random integer.Download src/uuid.js
or type npm install uuidjs
.
Load src/uuid.js
to get full functionality. If you only need UUID.generate()
method, load dist/uuid.core.js
.
// the simplest way to get an UUID (as a hexadecimal string)
document.writeln(UUID.generate()); // "0db9a5fa-f532-4736-89d6-8819c7f3ac7b"
// create a version 4 (random-numbers-based) UUID object
var objV4 = UUID.genV4();
// create a version 1 (time-based) UUID object
var objV1 = UUID.genV1();
// create an UUID object from a hexadecimal string
var uuid = UUID.parse("a0e0f130-8c21-11df-92d9-95795a3bcd40");
// UUID object as a string
document.writeln(uuid.toString()); // "a0e0f130-8c21-11df-92d9-95795a3bcd40"
document.writeln(uuid.hexString); // "a0e0f130-8c21-11df-92d9-95795a3bcd40"
document.writeln(uuid.bitString); // "101000001110000 ... 1100110101000000"
document.writeln(uuid.urn); // "urn:uuid:a0e0f130-8c21-11df-92d9-95795a3bcd40"
document.writeln(uuid.hexNoDelim); // "a0e0f1308c2111df92d995795a3bcd40"
// compare UUID objects
document.writeln(objV4.equals(objV1)); // false
// show version numbers
document.writeln(objV4.version); // 4
document.writeln(objV1.version); // 1
// get UUID field values in 3 different formats by 2 different accessors
document.writeln(uuid.intFields.timeLow); // 2699096368
document.writeln(uuid.bitFields.timeMid); // "1000110000100001"
document.writeln(uuid.hexFields.timeHiAndVersion); // "11df"
document.writeln(uuid.intFields.clockSeqHiAndReserved); // 146
document.writeln(uuid.bitFields.clockSeqLow); // "11011001"
document.writeln(uuid.hexFields.node); // "95795a3bcd40"
document.writeln(uuid.intFields[0]); // 2699096368
document.writeln(uuid.bitFields[1]); // "1000110000100001"
document.writeln(uuid.hexFields[2]); // "11df"
document.writeln(uuid.intFields[3]); // 146
document.writeln(uuid.bitFields[4]); // "11011001"
document.writeln(uuid.hexFields[5]); // "95795a3bcd40"
// avoid conflicts with other libraries (noConflict mode)
var arbitraryVarName = UUID;
UUID = UUID.overwrittenUUID; // restore original value
This library is licensed under the MIT license.
Copyright (c) 2010-2017 LiosK.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
LiosK contact@mail.liosk.net
FAQs
RFC-compliant UUID Generator for JavaScript
The npm package uuidjs receives a total of 6,725 weekly downloads. As such, uuidjs popularity was classified as popular.
We found that uuidjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.