
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
guid-factory
Advanced tools
Provides GUIDs via a factory class and supporting TypeScript typings
Provides GUIDs via a Guid
factory class and supporting guid
TypeScript typing.
Unlike similar typescript GUID/UUID libraries, all generated values exist as strings at run time, but still are able to be strongly-typed at build time due to the typescript flavoring.
The benefit is that the guid
typing needn't be instantiated as a new object, which plays nicer with server supplied values, as serialization/parsing from json isn't required.
npm i guid-factory
Import or require guid
and Guid
from 'guid-factory'
import { guid, Guid } from 'guid-factory'; // guid is the type, Guid is the factory
const myId: guid = Guid.newGuid();
const isValid = Guid.isValid(myId);
'00000000-0000-0000-0000-000000000000' === Guid.empty() // true
Member | Description |
---|---|
newGuid() | Generates a random, hyphenated guid value |
empty() | Generates a new guid, with the empty/least possible value |
full() | Generates a new guid, with the full/greatest possible value |
isEmpty() | Evaluates whether the supplied guid is equal to the empty/least possible value |
isFull() | Evaluates whether the supplied guid is equal to the full/greatest possible value |
isValid() | Evaluates whether the supplied value is a valid guid |
This library essentially marries two of the answers on this stack overflow question: https://stackoverflow.com/questions/49432350/how-to-represent-guid-in-typescript
MIT License
Copyright (c) 2021 Stony Hill Software LLC
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.
FAQs
Provides GUIDs via a factory class and supporting TypeScript typings
The npm package guid-factory receives a total of 2,705 weekly downloads. As such, guid-factory popularity was classified as popular.
We found that guid-factory demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.