Socket
Book a DemoInstallSign in
Socket

@boatgame-io/id-utils

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@boatgame-io/id-utils

Utilities for Boatgame.io IDs.

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

@krew-io/id-utils

Krew.io's official ID system.

ID Structure

IDs are created by combining an epoch date, a process ID, and an increment, similar to Twitter's Snowflake system. The Krew.io epoch is December 25th, 2020 0:00 UTC.

Snowflakes can be typed like so:

`${bigint}`

Snowflake typings are exported as KrewID.

Methods

You can create an ID using the following code:

import { createID } from '@boatgame-io/id-utils';
const newID = createID();

You can also extract dates with the getDate() method:

import { createID, getDate } from '@boatgame-io/id-utils';
const newID = createID();
const date = getDate(newID);

FAQs

Package last updated on 24 Nov 2021

Did you know?

Socket

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