Git Product home page Git Product logo

simpleuuid's Introduction

Simple Uuid

uuid::TimestampHandler

函数名称 返回值 可用于处理时钟回拨
getCurrentTimestamp 毫秒级时间戳
tryGetCurrentTimestamp 毫秒级时间戳

tryGetCurrentTimestamp 几种返回值的含义

  • 0 —— 发生时间回拨且回拨时间不超过 五秒
  • UINT64_MAX —— 发生时间回拨且回拨时间超过 五秒
  • 其它 —— 时间戳正常

uuid::Uuid 内存布局

---------------------------------------------
| selfId(8) |   r(8)    |   timestamp(48)   |
---------------------------------------------
字段 位数 说明
selfId 8 一般用于表示机器 ID
r 8 保留位,可自定义
timestamp 48 毫秒级时间戳

timestamp 在毫秒级别下能表示约 8925.513 年

simpleuuid's People

Contributors

shiinasama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.