Socket
Socket
Sign inDemoInstall

uuid64ts

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    uuid64ts

UUID v4 (random) Typescript/Javascript package with a custom base 64 encoding added.


Version published
Weekly downloads
7
increased by600%
Maintainers
1
Install size
42.8 kB
Created
Weekly downloads
 

Readme

Source

uuid4

Contributor Covenant Build Status Coverage Status

UUID v4 (random) Typescript/Javascript package with a custom base 64 encoding added.

Installation

Use the package manager npm to install uuid4.

npm i uuid4

Usage

import {Uuid4} from './Uuid4';

const base64 = Uuid4.asBase64();
const hex = Uuid4.asHexString();
const uuid = Uuid4.asUuid();
console.log('base64:');
console.log(base64);
console.log('hex:');
console.log(hex);
console.log('uuid:');
console.log(uuid);

Why make this project?

If this project was just another UUID v4 (random) library there would be little point as there are already several fine ones out there for Typescript and Javascript, but where they just do UUIDs this project targets being used with databases as a primary key. To really understand the fuller background without me having to reproduce it all here I'll just direct you to the PHP project that inspired this one to be created:

uuid64type

There you will find a few paragraphs on why I started it and why I think a base 64 encoded UUID v4 has many benefits.

https://github.com/Dragonrun1/uuid64type The project that this project was made to be a translation of but ended up causing a large re-write which became uuid64type's version 2.0.

Contributing

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update or add tests as appropriate.

License

BSD-3-Clause

Copyright (c) 2020 Michael Cummings. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Keywords

FAQs

Last updated on 23 Mar 2020

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