![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Programmer
Join Date: Jul 2005
Posts: 62
Rep Power: 4
![]() |
Quote:
![]() I'll be sure to look at it though and see if I can apply it to JS. ![]() |
|
|
|
|
|
|
#12 |
|
Professional Programmer
|
So you're trying to store compressed text in a database instead of normal text? To make the database smaller?
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;} |
|
|
|
|
|
#13 |
|
Programmer
Join Date: Jul 2005
Posts: 62
Rep Power: 4
![]() |
I'm writing a script to be used on third party software, which so happens to be a forum system. I creating an RPG, the information for each user will be stored in their signature, limited to 400 characters.
That's where the character limit comes from. It's nothing to do with file/db size. |
|
|
|
|
|
#14 | |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
|
|
#15 |
|
Programmer
Join Date: Jul 2005
Posts: 62
Rep Power: 4
![]() |
Thanks a lot for the idea. I can use PHP to implement it.
|
|
|
|
|
|
#16 | |
|
Professional Programmer
|
Quote:
You're probably going to have a lot of trouble getting a meaningful display out of echoing compressed data into a signature. I'd suggest writing the information-creation routine so that it creates less data in the first place, or rewrite a whole other compression idea that is lossy (like shorthand) and gives a meaningful display of the data.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;} |
|
|
|
|
|
|
#17 |
|
Programmer
Join Date: Jul 2005
Posts: 62
Rep Power: 4
![]() |
I understand the idea that detail is important, but I figured the maximum number of characters would be fine, and not why I wanted it that way.
The signature will be hidden using javascript, it's not meant to display the data directly, but rather to be read by javascript. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|