Skip to content

Implement 128-bit LID MVP (v0.1)

Closed Dec 18, 2023 100% complete

Problem

The problem that I have solved when I pass this milestone is that I need a prototype of an algorithm that generates 128-bit unique ids without generating random numbers at runtime.

Solution

The solution that got us past this milestone was to use a 36-bit second timestamp in the MSB, a 22-bit sub-second ticker, and a 70-bit randomly generated upon…

Problem

The problem that I have solved when I pass this milestone is that I need a prototype of an algorithm that generates 128-bit unique ids without generating random numbers at runtime.

Solution

The solution that got us past this milestone was to use a 36-bit second timestamp in the MSB, a 22-bit sub-second ticker, and a 70-bit randomly generated upon boot source id.

Problems with Solution

Different users will want different numbers of bits for the timestamp, subsecond ticker, and source ids. Also, I'm new to JavaScript and I bozoed how to use BigInt. For some reason, I thought that a BigInt was just a 64-bit integer, but it's an n-bit integer and I was still in the C++ mindset, so this code is not optimal. For 0.2.0 I will completely rewrite the algorithms to use BigInt correctly.

File Affected

  1. **/*.*

Hierarchy

Tags

Milestone

License

Copyright AStartup; all rights reserved.

This milestone is closed.

No open issues remain. View closed issues or see open milestones in this repository.