PHP
Token Bucket
Allow a short burst, then refill tokens at a steady rate. The burst cannot exceed the bucket size.
View code
Practical snippets you can use freely, each with a short description and a real-world example.
3 results
Allow a short burst, then refill tokens at a steady rate. The burst cannot exceed the bucket size.
Reuse an idle connection inside the same process, instead of opening a new one for every query.
Store a password as a salted hash, with a pepper from app config. This is not reversible encryption.
Describe the problem or idea, and I will see if it belongs in the library.