Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eloyekunle/random_string
Native PHP extension in C++ to generate a random string.
https://github.com/eloyekunle/random_string
php-cpp php-extension php7 random-string
Last synced: 25 days ago
JSON representation
Native PHP extension in C++ to generate a random string.
- Host: GitHub
- URL: https://github.com/eloyekunle/random_string
- Owner: eloyekunle
- Created: 2017-07-24T11:17:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-24T11:34:49.000Z (over 7 years ago)
- Last Synced: 2024-10-29T10:47:33.625Z (2 months ago)
- Topics: php-cpp, php-extension, php7, random-string
- Language: Makefile
- Homepage:
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
I sure thought writing a native PHP extension in C++ would make string generation faster for the thousands I'll have to generate periodically in my web service.
**Boy, was I wrong.** At least I got to write my first PHP extension. :D
Well, here's the source code, tested and working on Ubuntu 17.04.
You might have to edit the Makefile to the appropriate PHP extensions location on your computer.It's based on [PHP-CPP](http://www.php-cpp.com/documentation/introduction)
You'll have to [install](http://www.php-cpp.com/documentation/install) PHP-CPP on your server, then download appropriate php-dev tools for your server.
This should work just fine on Ubuntu;
```
sudo apt-get install php7.0-dev
```Compiling:
```
make
```Then to install;
```
sudo make install
```Oh, well. What a beautiful day.
[Elijah Oyekunle](https://elijahoyekunle.com)