Skip to content

added security doc #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
added security doc
  • Loading branch information
abmmhasan committed May 6, 2024
commit 08293d95fcd4172377ff7bb4db208b4938b31948
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@

[![build](https://github.com/infocyph/UID/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/infocyph/UID/actions/workflows/build.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cec4c7ed0e274b3da4571973732a363e)](https://app.codacy.com/gh/infocyph/UID/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/infocyph/uid)
![Packagist Downloads](https://img.shields.io/packagist/dt/infocyph/uid)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
![Packagist Version](https://img.shields.io/packagist/v/infocyph/uid)
![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/infocyph/uid)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/infocyph/uid)

An AIO Unique ID generator for php. Supports,
An AIO Unique ID generator written in PHP. Supports,
- UUID (RFC 4122 + Unofficial/Draft)
- ULID (ulid specification)
- Snowflake ID (Twitter Snowflake specification)
- Sonyflake ID (Snowflake Inspired specification, ported from Golang)
- Snowflake ID (Twitter Snowflake)
- Sonyflake ID (Snowflake Inspired, ported from Golang)
- TBSL (library exclusive)

## Table of contents
Expand Down Expand Up @@ -134,7 +133,7 @@ But, if you wanna track the source of the UUIDs, you should use it (pre-define t
// alternatively can also use
\Infocyph\UID\uuid6();
```
- Or if you wanna get v6 UUID using predefined node:
- Get v6 UUID using predefined node:
```php
\Infocyph\UID\UUID::v6($node); // check additional section for how to generate one
```
Expand All @@ -148,7 +147,7 @@ But, if you wanna track the source of the UUIDs, you should use it (pre-define t
// alternatively can also use
\Infocyph\UID\uuid7();
```
- Or if you wanna get v7 UUID using predefined node:
- Get v7 UUID using predefined node:
```php
\Infocyph\UID\UUID::v7(null, $node); // check additional section for, how to generate one
```
Expand All @@ -157,7 +156,7 @@ But, if you wanna track the source of the UUIDs, you should use it (pre-define t
$timeInterface = new DateTime(); // DateTime implements DateTimeInterface
\Infocyph\UID\UUID::v7($timeInterface);
```
- You can combine both parameters together.
- You can combine both parameters together as well.

#### UUID v8 (draft-based/unofficial): Time-based UUID. Lexicographically sortable.

Expand All @@ -168,7 +167,7 @@ $timeInterface = new DateTime(); // DateTime implements DateTimeInterface
// alternatively can also use
\Infocyph\UID\uuid8();
```
- Or if you wanna get v8 UUID using predefined node:
- Get v8 UUID using predefined node:
```php
\Infocyph\UID\UUID::v8($node); // check additional section for, how to generate one
```
Expand Down
17 changes: 17 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Security Policy

![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/infocyph/uid)

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
|---------|--------------------|
| 2.x | :white_check_mark: |
| 1.x | :x: |

## Reporting a Vulnerability

Report any vulnerabilities to the [security advisory tracker](https://github.com/abmmhasan/uid/issues)!
9 changes: 9 additions & 0 deletions TBSL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# TBSL

A 20 character alphanumeric ID generated by a time-based lexicographically sortable algorithm. It stores time in first
13 characters and machine ID in 14th-15th characters. Rest 5 is randomly generated.

| Time Identifier | Machine Identifier | Random Character |
|:---------------:|:------------------:|:----------------:|
| 13 | 2 | 5 |