You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With this library, you can transform your internal id's to obfuscated integers based on Knuth's integer hash. It is similar to Hashids, but will generate integers instead of random strings. It is also super fast.
If you will be running your code on a 32 bit system or will be working with large prime numbers it is suggested that you install the [GMP extension](http://php.net/manual/en/book.gmp.php). For debian/ubuntu you can install the extension with one of these commands:
22
+
If you will be running your code on a 32 bit system or will be working with large prime numbers it is suggested that you install the [GMP extension](http://php.net/manual/en/book.gmp.php).
23
+
For debian/ubuntu you can install the extension with one of these commands:
23
24
24
-
```
25
+
```bash
25
26
apt-get install php7.0-gmp
26
27
apt-get install php7.1-gmp
27
28
apt-get install php7.2-gmp
29
+
apt-get install php7.3-gmp
30
+
apt-get install php7.4-gmp
28
31
```
29
32
30
-
Usage
31
-
-----
33
+
## Usage
32
34
33
35
To get started you will need 3 things;
34
36
@@ -38,7 +40,7 @@ To get started you will need 3 things;
38
40
39
41
Luckily for you, I have included a console command that can do all of this for you. To get started, just run the following command:
40
42
41
-
```
43
+
```bash
42
44
> php vendor/bin/optimus spark
43
45
44
46
Prime: 2123809381
@@ -48,7 +50,7 @@ Random: 146808189
48
50
49
51
If you prefer to choose your own prime number (from [this list](http://primes.utm.edu/lists/small/millions/) for example), you can pass it to the command to calculate the remaining numbers:
50
52
51
-
```
53
+
```bash
52
54
> php vendor/bin/optimus spark 1580030173
53
55
54
56
Prime: 1580030173
@@ -135,16 +137,16 @@ More information: https://laravel.com/docs/5.3/container#resolving
135
137
136
138
**Third-party integrations**
137
139
138
-
An integration with Laravel is provided by the [propaganistas/laravel-fakeid](https://packagist.org/packages/propaganistas/laravel-fakeid) package.
139
-
140
-
Laravel Optimus with multiple connections provided by the [cybercog/laravel-optimus](https://github.com/cybercog/laravel-optimus) package.
141
-
142
-
An integration with Silex 2 is provided by the [jaam/silex-optimus-provider](https://packagist.org/packages/jaam/silex-optimus-provider) package.
143
-
144
-
An integration with Laravel is provided by the [elfsundae/laravel-hashid](https://github.com/ElfSundae/laravel-hashid) package.
145
-
146
-
A PSR-15 middleware provided by the [icanhazstring/optimus-middleware](https://github.com/icanhazstring/optimus-middleware) package.
140
+
* An integration with Laravel is provided by the [propaganistas/laravel-fakeid](https://packagist.org/packages/propaganistas/laravel-fakeid) package.
141
+
* Laravel Optimus with multiple connections provided by the [cybercog/laravel-optimus](https://github.com/cybercog/laravel-optimus) package.
142
+
* An integration with Silex 2 is provided by the [jaam/silex-optimus-provider](https://packagist.org/packages/jaam/silex-optimus-provider) package.
143
+
* An integration with Laravel is provided by the [elfsundae/laravel-hashid](https://github.com/ElfSundae/laravel-hashid) package.
144
+
* A PSR-15 middleware provided by the [icanhazstring/optimus-middleware](https://github.com/icanhazstring/optimus-middleware) package.
147
145
148
146
## Security contact information
149
147
150
148
To report a security vulnerability, follow [these steps](https://tidelift.com/security).
149
+
150
+
## License
151
+
152
+
The [MIT](https://opensource.org/licenses/MIT) License.
0 commit comments