Controlling randomness in Laravel (watch me code)

Опубликовано: 17 Июнь 2024
на канале: Aaron Francis
5,456
268

Laravel's Str::random and Lottery helpers produce random results, which is usually what we're looking for! But sometimes we want repeatable randomness. In this video we take a look at how to control the randomness.

Follow Aaron:
Twitter:   / aarondfrancis  
LinkedIn:   / aarondfrancis  
Website: https://aaronfrancis.com - find articles, podcasts, courses, and more.

Featured in this episode:
https://laravel.com/docs/11.x/strings...
https://laravel.com/docs/11.x/helpers...

Chapters:
00:00 - Introduction to Benchmarking and Random Value Generation
01:36 - Introduction to Mersenne Twister and Seeding Randomness
02:58 - Example of Repeatable Random Values with Mersenne Twister
03:54 - Wrapping Randomness Control in Laravel
04:52 - Creating Predictable Random Strings
06:00 - Generating Repeatable Random Strings
08:01 - Controlling Lottery Results with Predictable Randomness
09:58 - Modifying Lottery Class for Seeding Randomness
10:54 - Testing and Verifying Lottery Randomness
12:07 - Improving and Resetting Randomness for Benchmarking
13:47 - Refactoring for Global Seeding and Control
15:11 - Debugging and Stabilizing Randomness for Multiple Calls
17:18 - Finalizing Predictable Randomness for Benchmarks
19:09 - Considering Edge Cases and Final Thoughts
20:17 - Conclusion and Feedback Request


Смотрите видео Controlling randomness in Laravel (watch me code) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Aaron Francis 17 Июнь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 5,456 раз и оно понравилось 268 людям.