How to set the source of <script> to be an encrypted string?

Suppose I want to include a script in my website:

http://files/myfunction.js

Now what I want to do is encrypt or encode, whatever you call it, the src i.e. “files/myfunction.js” and use that instead in the src of the script so that normal people can’t see it. So that it looks something like:

http://zxcshdgfoiqjkfnasfgbkjsd

And the above script should still point to the myfunction.js file.
I know it’s not a good option but I just need answers that how can this be achieved?
I’ve seen numerous examples on stackoverflow but none point to what I want specifically.
Any help would be really appreciated. Thanks


Source: stackoverflow-javascript

PHP Crypt seems to create the same string for crypt(A,myhash) as crypt((A.B,myhash) where A is greater than 8 digits.

The title sort of says it all, but I’m wondering how to avoid this. My password validation currently does this frustrating thing where Password = Password works, but so does Password = Passwordssssssss

Shorter strings like Password = test don’t exhibit this behavior.

I feel like this means there’s no point in having a password longer than 8 digits which I find confusing… Thoughts?


Source: stackoverflow-php