• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Introducing pikaid: Small · Sortable · Secure Unique IDs

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Hey everyone!

I’m Lara, a Belgian web developer, and this is the very first repo I’ve kicked off entirely on my own. I wanted a compact, drop-in unique ID you can stash in any database and have sort itself—no extra tricks needed. UUIDs felt bulky, ULIDs a bit low on randomness, so I thought: why not stick to 26 chars, switch to Base36, and pack in 96 bits of cryptographic entropy? That’s Pikaid in a nutshell.

? The Problem

  • UUIDs are 36 characters with dashes, and you need extra logic to sort them.
  • ULIDs nail the 26-char size and sorting, but cap out at 80 bits of randomness.
  • We’re often forced to pick between length, sortability, or entropy.

I wanted one ID that’s:

  1. 26 chars long
  2. Sortable by creation time out of the box
  3. Packed with 96 bits of randomness
  4. Simple: just 0–9a–z, no extra symbols
? Meet Pikaid

  • Length: 26 chars
  • Alphabet: lowercase Base36 (0–9, a–z)
  • Structure: 7 chars timestamp (seconds since epoch, Base36, zero-padded), 19 chars randomness (96 bits, Base36, zero-padded)
  • Sortable: lex order = creation time
  • Secure: ~7.9×10²⁸ combos → collisions are practically impossible
⚡ Quickstart (PHP)


<?php

use Pikaid\Pikaid;

require 'vendor/autoload.php';

$id = Pikaid::generate();

echo $id; // e.g. 'kfz1w5x0ab9c23d4e5f6g7h8ij'

JavaScript version coming soon—stay tuned!

? Roadmap & Contributions


I’m working on:

  • Full JS implementation
  • ???

This is my first public repo, so I probably messed up a few things. Please:

  • Flag any unclear spots in the spec
  • Suggest extra use cases or edge cases
  • Open issues & PRs with ideas
  • Guide me on open-source best practices

Your feedback will help me level up and make Pikaid rock-solid.

? Get Involved


? Specifications Repo:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.


? PHP Repo:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.


? License: MIT

Big thanks for giving Pikaid a spin! I hope you find it useful—drop your thoughts, point out any mistakes, and let’s build something awesome together.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу