An open API service indexing awesome lists of open source software.

https://github.com/colorfulcompany/slothful-code-generator

ms単位のそこそこの精度のtime-basedでuniqueなIDを人間の扱いやすい桁数で生成する
https://github.com/colorfulcompany/slothful-code-generator

foundation id ruby rubygems

Last synced: 9 months ago
JSON representation

ms単位のそこそこの精度のtime-basedでuniqueなIDを人間の扱いやすい桁数で生成する

Awesome Lists containing this project

README

          

# SlothfulCode

ある程度人間にとって扱いやすい長さ、複雑さで、類推しにくく、重複しないコードを生成、検証する

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'slothful-code-generator'
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install slothful-code-generator

## Usage

```ruby
require 'slothful_code'
```

### ganerate

```ruby
sc = SlothfulCode.new()
sc.generate(type_id: '1') # => '989JV7WDCN6Q-1'
```

### decode

```ruby
sc = SlothfulCode.new()
sc.decode() # => {:type_id=>'1', :time=>[1612769809, 113]}
```

### valid?

```ruby
sc = SlothfulCode.new()
sc.valid?() # => true / false
```