npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dyna-guid

v2.1.2

Published

Javascript GUID generator

Downloads

656

Readme

dyna guid V2

A simple guid generator.

The chance to get the same guid is one in 18,446,744,073,709,600,000 on the same millisecond in the same timezone!

Samples

139aca66-2024bc60-2f847b9701be62a163 // Fixed length: 36

12f5ade5-54356610-2f847b9702f0b91635

216f48d8-233eb6b0-2f847b970379de20d6

Comparison with others

dyna guid v2: 1e955ef4-47939014-2f847b9700c03a2a3b

dyna guid v1: 1g6263bg-1h2c3a89-18046497750547120

   .net guid: 30dd879c-ee2f-11db-8314-0800200c9a66

The difference is that dyna guid is

  • hard to generate the same on the same millisecond per timezone and
  • impossible to generate the same on next millisecond!

dyna guid syntax

<random block>-<random block>-<timestamp>

The default of the random blocks is 2, would be 1 or any other number.

Usage

import {guid} from "dyna-guid";

console.log('guid', guid());
console.log('even stronger guid', guid(3));
  

Method

function guid(randomBlocks: number = 2): string

Block is a set of 8 chars separated with dashes.

If you need even more complex guids (!why?) you can increase the number of blocks. Or for shorter set it to 1.

Change log

V1 05-Aug-2017

Sample: 1g6263bg-1h2c3a89-18046497750547120

V2 20-Jan-2022

Sample: 18ee7d36-14d00ef3-2f847b9703c45725c7

  • Fixed size, doesn't change cause current date
  • Better random blocks