simonhamp
simonhamp

Simon Hamp

Verified

@simonhamp

#PHP4Life

7 Answers 807 views

/ 255

Simon as a note, uniqid is not cryptographically secure as it is based on the current time in milliseconds. Aside security, I've encountered a situation where duplicates ids were happening due to multiple employees doing a similar action at the same time.

👍🏼

562 views

?

Anonymously

Hi Simon,
What is your favorite php function ?

😂 interesting question! I've never really thought about it.

I guess if you twisted my arm I'd say `uniqid`. It's a pretty good way to quickly and easily generate a unique ID, which is great for customer-facing identifiers.

It also allows you to pass a `prefix` argument, so you can use it to get meaningful IDs really easily without having to resort to a third-party library.

For example, if you have a system that uses multiple kinds of publicly-accessible tokens to identify different entities, prefixing each entity's `uniqid` with their own prefix can be an easy way to spot which type of entity it's referring to.

Imagine a piece of accounting software:

uniqid('U-') // could be for users
uniqid('I-) // could be for invoices
uniqid('P-') // could be for payments


It's not perfect and it won't work in all situations, but I've built some pretty large scale systems using this and it's been fine!

It's surprising how far you can go with PHP's standard library sometimes.

575 views

?

Anonymously

Hello Simon. First of all thank you very much for your work with NativePHP, it's such a great tool.

Now that tauri v2 is in beta versions and includes mobile support, do you have any future vision to integrate this same support for native?

Yes! Tauri is where NativePHP started and I have been working on that side of NativePHP for over a year now.

My goals are pretty lofty for that tho, as I want to make it the most secure and performant version of NativePHP to date.

Look out for some significant developments on that front in the coming months.

Join the Discord to be the first to hear any news and please consider sponsoring so I can bring it to life sooner.

573 views

ElectronJS alternative is NativePHP for desktop application.
Which one alternative of React Native for Mobile Apps (Application) ?

Right no, there isn't one, but I've been looking at Expo, which builds on ReactNative and seems to make it a little more accessible.

Maybe something could be done there.

On the other hand, Tauri 2 is coming soon and that has mobile support.

So keep your eyes peeled

907 views

?

Anonymously

hey, thanks for laradir project.

That's nice! Thank *you*. Please feel free to give me feedback and criticism so I can keep making it better for you and other Laravel devs

807 views