🦀 Rust-based implementation of a Snowflake Generator which communicates using gRPC

Overview

Clawflake

Clawflake is a Rust application which implements Twitter Snowflakes and communicates using gRPC.

Snowflake ID numbers are 63 bits integers stored as i64.

An ID number is composed of:

  • a timestamp (which is the difference between the current time and the epoch) [41 bits]
  • a configured machine ID (Data center ID and Worker ID) [10 bits]
  • a sequence number which rolls over every 4096 per machine (with protection to avoid rollover in the same ms) [12 bits]

Usage

You need to use the nightly toolchain!

Run the container

docker run -e CLAWFLAKE_EPOCH=<epoch> -e CLAWFLAKE_WORKER_ID=<worker_id> -e CLAWFLAKE_DATACENTER_ID=<datacenter_id> -p <host port>:50051 docker pull n1c00o/clawflake

(or you can build from source)

You can then create your client using clawflake.rs and start communicate with the service.

An example client can be found here!

You might also like...
A simple, fast, easy README generator
A simple, fast, easy README generator

Welcome to Readme Generator A simple, fast, easy README generator. Never worry about READMEs again! What it does: Run the command in your project's di

Boot tools: loader, image generator, etc as a library crate

ArcBoot v0 A uefi bootloader for riscv, arm and x86. Comes in the form of a single executable. the source code contains a single executable target and

Quad-rand implements pseudo-random generator

quad-rand quad-rand implements pseudo-random generator based on rust atomics. Compatible with wasm and any oth

⚙️ A cute .gitignore generator with support for custom templates
⚙️ A cute .gitignore generator with support for custom templates

Gign A Gitignore Generator Table of Contents Examples Install Custom templates Help Examples # This is how you going to use it probably most of the ti

 A dynamic image generator.
A dynamic image generator.

dynimgen A dynamic image generator. How to use step 1: The designers export the design drawing as an svg file svg rect / image src="img.png"

waveplot is a VCD waveform generator for the terminal.

waveplot waveplot is a VCD waveform generator for the terminal. Installation (dev) Install the Rust compiler 'rustc' using rustup. curl --proto '=http

Rust crate which provides direct access to files within a Debian archive

debarchive This Rust crate provides direct access to files within a Debian archive. This crate is used by our debrep utility to generate the Packages

A rust interval arithmetic library which provides flags that detect domain errors.

intervals-good A Rust interval arithmetic library which provides flags that detect domain errors, supports more functions than any other interval arit

Massayo is a small proof-of-concept Rust library which removes AV/EDR hooks in a given system DLL

Massayo Massayo is a small proof-of-concept Rust library based on UnhookingPOC, which removes AV/EDR hooks in a given system DLL. I tried to reduce fi

Comments
  • Bump hyper from 0.14.11 to 0.14.15

    Bump hyper from 0.14.11 to 0.14.15

    Bumps hyper from 0.14.11 to 0.14.15.

    Release notes

    Sourced from hyper's releases.

    v0.14.15

    Bug Fixes

    • client: cancel blocking DNS lookup if GaiFuture is dropped (174b553d)

    Features

    • http1: add http1_writev(bool) options to Client and Server builders, to allow forcing vectored writes (80627141)
    • upgrade: allow http upgrades with any body type (ab469eb3)

    New Contributors

    v0.14.14

    Bug Fixes

    • client:
      • make ResponseFuture implement Sync (bd6c35b9)
      • remove ipv6 square brackets before resolving (910e0268)

    Features

    • http2: always include original h2 error on broken pipe (6169db25)
    • server: Remove Send + Sync requirement for Body in with_graceful_shutdown (1d553e52)

    v0.14.13

    Bug Fixes

    • client: don't reuse a connection while still flushing (c88011da)
    • server: convert panic to error if Connection::without_shutdown called on HTTP/2 conn (ea3e2282)

    Features

    • ffi: add hyper_request_set_uri_parts (a54689b9)
    • lib:
      • Export more things with Cargo features (server, !http1, !http2) (0a4b56ac)
      • Export rt module independently of Cargo features (cf6f62c7)

    v0.14.12

    Bug Fixes

    • ffi: on_informational callback had no headers (39b6d01a)
    • http1: apply header title case for consecutive dashes (#2613) (684f2fa7)
    • http2: improve errors emitted by HTTP2 Upgraded stream shutdown (#2622) (be08648e)

    ... (truncated)

    Changelog

    Sourced from hyper's changelog.

    v0.14.15 (2021-11-16)

    Bug Fixes

    • client: cancel blocking DNS lookup if GaiFuture is dropped (174b553d

    Features

    • http1: add http1_writev(bool) options to Client and Server builders, to allow forcing vectored writes (80627141)
    • upgrade: allow http upgrades with any body type (ab469eb3)

    v0.14.14 (2021-10-22)

    Bug Fixes

    • client:
      • make ResponseFuture implement Sync (bd6c35b9)
      • remove ipv6 square brackets before resolving (910e0268)

    Features

    • h2: always include original h2 error on broken pipe (6169db25)
    • server: Remove Send + Sync requirement for Body in with_graceful_shutdown (1d553e52)

    v0.14.13 (2021-09-16)

    Bug Fixes

    • client: don't reuse a connection while still flushing (c88011da)
    • server: convert panic to error if Connection::without_shutdown called on HTTP/2 conn (ea3e2282)

    Features

    • ffi: add hyper_request_set_uri_parts (a54689b9)
    • lib:
      • Export more things with Cargo features (server, !http1, !http2) (0a4b56ac)
      • Export rt module independently of Cargo features (cf6f62c7)

    v0.14.12 (2021-08-24)

    Bug Fixes

    ... (truncated)

    Commits
    • d0b1d9e v0.14.15
    • a1502e1 docs(http1): clarify HTTP1 preserve case option
    • a12db28 docs(upgrade): add module documentation for HTTP upgrades
    • 7f5e853 refactor(benches): make benchmark names more consistent
    • 174b553 fit(client): cancel blocking DNS lookup if GaiFuture dropped (#2689)
    • 913be88 docs(client): fix missing feature attrs in another doctest
    • 3221f57 docs(body) fix doctest failing due to missing features
    • 8062714 feat(http1): Add http1_writev(bool) to client and server Builders
    • ab469eb feat(upgrade): allow http upgrades with any body type
    • b5022f3 v0.14.14
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 2
  • Bump tokio from 1.9.0 to 1.13.1

    Bump tokio from 1.9.0 to 1.13.1

    Bumps tokio from 1.9.0 to 1.13.1.

    Release notes

    Sourced from tokio's releases.

    Tokio v1.13.1

    1.13.1 (November 15, 2021)

    This release fixes a data race when sending and receiving on a closed oneshot channel (RUSTSEC-2021-0124).

    Fixed

    • sync: fix a data race between oneshot::Sender::send and awaiting a oneshot::Receiver when the oneshot has been closed (#4226)

    Tokio v1.13.0

    1.13.0 (October 29, 2021)

    Fixed

    • sync: fix Notify to clone the waker before locking its waiter list (#4129)
    • tokio: add riscv32 to non atomic64 architectures (#4185)

    Added

    • net: add poll_{recv,send}_ready methods to udp and uds_datagram (#4131)
    • net: add try_*, readable, writable, ready, and peer_addr methods to split halves (#4120)
    • sync: add blocking_lock to Mutex (#4130)
    • sync: add watch::Sender::send_replace (#3962, #4195)
    • sync: expand Debug for Mutex<T> impl to unsized T (#4134)
    • tracing: instrument time::Sleep (#4072)
    • tracing: use structured location fields for spawned tasks (#4128)

    Changed

    • io: add assert in copy_bidirectional that poll_write is sensible (#4125)
    • macros: use qualified syntax when polling in select! (#4192)
    • runtime: handle block_on wakeups better (#4157)
    • task: allocate callback on heap immediately in debug mode (#4203)
    • tokio: assert platform-minimum requirements at build time (#3797)

    Documented

    • docs: conversion of doc comments to indicative mood (#4174)
    • docs: add returning on the first error example for try_join! (#4133)
    • docs: fixing broken links in tokio/src/lib.rs (#4132)
    • signal: add example with background listener (#4171)
    • sync: add more oneshot examples (#4153)
    • time: document Interval::tick cancel safety (#4152)

    #3797: tokio-rs/tokio#3797 #3962: tokio-rs/tokio#3962

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 2
Releases(v1.0.0)
Owner
n1c00o
Creating, debugging, dockerizing
n1c00o
A simple to use rust package to generate or parse Twitter snowflake IDs,generate time sortable 64 bits unique ids for distributed systems

A simple to use rust package to generate or parse Twitter snowflake IDs,generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)

houseme 5 Oct 6, 2022
Universal changelog generator using conventional commit+ with monorepo support. Written in Rust.

chlog Universal changelog generator using conventional commit+ with monorepo support. chlog can generate the changelog from the conventional commits w

Jeff Yang 3 Nov 27, 2022
A simple quote-based code generator for Rust

flexgen A flexible, yet simple quote-based code generator for creating beautiful Rust code Why? Rust has two types of macros, and they are both very p

Scott Meeuwsen 11 Oct 13, 2022
Pure rust implementation of python's random module with compatible generator behaviour.

pyrand Pure rust implementation of (parts of) python's random module with compatible PRNG behaviour: seeding with equivalent values will yield identic

Stefan V. 4 Feb 10, 2024
A lightweight new Bing (AI chat) desktop application which based on Tauri.

Bing Lite A lightweight new Bing (AI chat) desktop application which based on Tauri. No more Microsoft Edge, no more Chromium/Electron! Download The l

a.e. 6 Apr 5, 2023
A memory-based evasion technique which makes shellcode invisible from process start to end.

phantom A memory-based evasion technique which makes shellcode invisible from process start to end. Motivation ShellGhost Offensive Edition, and rust!

B1-TEAM 5 Sep 15, 2023
A simple code boilerplate generator written in Rust.

?? Cgen What is Cgen? A modern, cross-platform, multi-language boilerplate generator aimed to make your code generation less hectic! If you wish to su

Rithul Kamesh 1 Dec 25, 2021
Nexmark event generator in Rust.

Nexmark-rs The Nexmark benchmark data generator in Rust. Installation cargo install nexmark --features bin Usage Generate nexmark events. Print one pe

RisingWave Labs 11 Nov 27, 2022
A code generator to reduce repetitive tasks and build high-quality Rust libraries. 🦀

LibMake A code generator to reduce repetitive tasks and build high-quality Rust libraries Welcome to libmake ?? Website • Documentation • Report Bug •

Sebastien Rousseau 27 Mar 12, 2023
Dead simple, minimal SPDX License generator library written in Rust.

lice Dead simple, minimal SPDX License generator library written in Rust. Lice is in beta Install | User Docs | Crate Docs | Reference | Contributing

refcell.eth 9 Oct 22, 2023