Advertisement
C_Volume2 Internet/ Browsers/ HTML #81069

[[ Protect your .js files - A true and effective way

After spending several weeks debuging a script, it's not nice knowing that any dumb web designer can steel your code without permission. This solution uses ASP and cookies to encrypt the code inside javascript functions. The key to decrypt the code is stored in a cookie, so the client can't get it. There must be some way to hack this, but it will keep your code away from 99% users. If you find a way to hack it, post a comment. It would help to improve the code. I've seen other solutions in PSC but none of them work as this one. Don't forget to vote!

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Upload
/* Code Example - mutable keyword
 written by Jared Bruni
 www.LostSideDead.com
 "Open Source, Open Mind"
*/
#include<iostream>
#include<string>
using namespace std;
class Date {
int m,d,y;
mutable bool cache_there;
mutable string cache;
public:
 	Date();
	Date(int mm, int dd, int yy);
	
 	void setdate(int mm, int dd, int yy);
	int getday() const;
	int getmonth() const;
	int getyear() const;
	void setcache() const;
	string cpp_str() const;
};
Date::Date()
{
	m = 0;
	d = 0;
	y = 0;
}
Date::Date(int mm, int dd, int yy)
{
	m = mm;
	y = yy;
	d = dd;
}
void Date::setdate(int mm, int dd, int yy)
{
	m = mm;
	d = dd;
	y = yy;
	cache_there = false;
	cache = "";
}
int Date::getmonth() const
{
	return m;
}
int Date::getyear() const
{
	return y;
}
int Date::getday() const
{
	return d;
}
void Date::setcache() const
{
	char mm[25];
	char dd[25];
	char yy[25];
	itoa(m,mm,10);
	itoa(d,dd,10);
	itoa(y,yy,10);
 	cache = "";
	cache += mm;
	cache += "/";
	cache += dd;
	cache += "/";
	cache += yy;
}
string Date::cpp_str() const
{
	if(cache_there == false)
	{
		setcache();
		cache_there = true;
	}
	return cache;
}
int main()
{
	Date date;
	date.setdate(1,12,2002);
	cout << date.cpp_str() << endl;
	system("pause");
	return (0);
}
Original Comments (3)
Recovered from Wayback Machine