Skip to content

bubao/cherry-id-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌸 cherry-id

NPM version jaywcjlove/sb

Introduction

The core algorithm copyright belongs to yitter

more:https://github.com/yitter/IdGenerator

USing cherry-id

npm i cherry-id
const GenId = require('cherry-id');
const genid = new GenId({ WorkerId: (process.argv[2] || 1) - 0 });

(() => {
  console.time("Test Run");
  const HSet = new Set();
  for (let index = 0; index < 500000; index++) {
    HSet.add(genid.NextId());
  }
  console.timeEnd("Test Run");
  console.log([...HSet.values()].join("\n"))
  console.log(HSet.size);
})();

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published