|
7 Jan 2009, 21:53
|
#1
|
Registered User
Join Date: Nov 2008
Posts: 401
|
Change to Scan IDs
For people coding external tool sites that wish to parse scans, it is rather useful to store the IDs of scans and scan groups, usually inside a database. Fortunately the biggest number an Integer (as defined by the ANSI SQL standard) can take is 2.1 billion, and so it should be no problem.
Unfortunately it seems that PA uses IDs bigger than this. Why on earth you need more than 2 billion possible IDs I do not know.
In an attempt to provide an open source and easily accessible tools set, this becomes a problem for myself and others. (In order to maintain my database agnostic stance -part of the easily accessible thing- I must accept that there is no such thing as a "BigInteger".)
Please could the code for generating these IDs be modified to resolve this problem? Shouldn't take more than 5 minutes
Thanks
|
|
|
7 Jan 2009, 22:13
|
#2
|
PA Team
Join Date: Oct 2003
Posts: 7,449
|
Re: Change to Scan IDs
As mentioned in #support, we used an unsigned integer.
We use a wide number to make it impossible for an alliance to go through all potential numbers and 'steal' scans.
__________________
r8-10 RaH r10.5-12 MISTU
|
|
|
7 Jan 2009, 23:14
|
#3
|
Registered User
Join Date: Nov 2008
Posts: 401
|
Re: Change to Scan IDs
Thanks for discussion in #support.
In light of Cin's plans for the future I will change my storage strategy.
|
|
|
8 Jan 2009, 01:51
|
#4
|
This Space for Rent
Join Date: Jun 2007
Posts: 583
|
Re: Change to Scan IDs
on a side note, could you get by with just using a string ellonweb? they probably use an integer in order to randomize them. since the number is already generated and won't change you can probably use a string and just concatenate the url to create a link?
__________________
When in doubt, blame Ascendancy.
#pastats
|
|
|
8 Jan 2009, 08:13
|
#5
|
mz.
Join Date: Aug 2005
Posts: 8,587
|
Re: Change to Scan IDs
Not very elegant though.
__________________
The outraged poets threw sticks and rocks over the side of the bridge. They were all missing Mary and he felt a contented smug feeling wash over him. He would have given them a coy little wave if the roof hadn't collapsed just then. Mary then found himself in the middle of an understandably shocked family's kitchen table. So he gave them the coy little wave and realized it probably would have been more effective if he hadn't been lying on their turkey.
|
|
|
8 Jan 2009, 19:03
|
#6
|
Registered User
Join Date: Nov 2008
Posts: 401
|
Re: Change to Scan IDs
Cin's future plan involves switching scan ids to alphanumerics, so yeh I'll use a string. When you think about it, the id doesn't actually represent anything, it is just a key to get at the data so while storing a number as a string is usually a horrible thing, in this case it's not so bad. And I'll be future-compatible.
On a side note Cin said the change won't be made for this round (on scans, anyway), and when it does he'll make sure to give plenty of advance warning for those operating tool sets.
|
|
|
8 Jan 2009, 19:53
|
#7
|
PA Team
Join Date: Apr 2004
Posts: 1,874
|
Re: Change to Scan IDs
Quote:
Originally Posted by ellonweb
Cin's future plan involves switching scan ids to alphanumerics, so yeh I'll use a string. When you think about it, the id doesn't actually represent anything, it is just a key to get at the data so while storing a number as a string is usually a horrible thing, in this case it's not so bad. And I'll be future-compatible.
On a side note Cin said the change won't be made for this round (on scans, anyway), and when it does he'll make sure to give plenty of advance warning for those operating tool sets.
|
i said it is unlikely that it'll happen for r30, not that it won't, and that i'd announce it to give ppl time to update their tools, nothing about "plenty of advance warning".
__________________
Requested: 1,000 kilometres of fulcrum cable, 1 Mark 5 ECM unit, one low yield nuclear weapon.
Purpose: Surprise party for foreign dignitary
|
|
|
8 Jan 2009, 21:20
|
#8
|
mz.
Join Date: Aug 2005
Posts: 8,587
|
Re: Change to Scan IDs
ITT, Cin shows how much PA Team cares about its users. Keep up the good work, Cin!
__________________
The outraged poets threw sticks and rocks over the side of the bridge. They were all missing Mary and he felt a contented smug feeling wash over him. He would have given them a coy little wave if the roof hadn't collapsed just then. Mary then found himself in the middle of an understandably shocked family's kitchen table. So he gave them the coy little wave and realized it probably would have been more effective if he hadn't been lying on their turkey.
|
|
|
8 Jan 2009, 21:29
|
#9
|
Banned
Join Date: May 2001
Location: Further to the right
Posts: 19,441
|
Re: Change to Scan IDs
Quote:
Originally Posted by Cincinnatus
i said it is unlikely that it'll happen for r30, not that it won't, and that i'd announce it to give ppl time to update their tools, nothing about "plenty of advance warning".
|
There were people who ran concentration camps who had better people skills than you.
__________________
Some might ask what good is life without purpose but I'm anticipating a good lunch.
|
|
|
9 Jan 2009, 10:03
|
#10
|
Banned
Join Date: Jul 2003
Location: ******
Posts: 2,326
|
Re: Change to Scan IDs
Quote:
Originally Posted by Cincinnatus
i said it is unlikely that it'll happen for r30, not that it won't, and that i'd announce it to give ppl time to update their tools, nothing about "plenty of advance warning".
|
May I ask why you plan on changing to alphanumerics?
|
|
|
9 Jan 2009, 14:17
|
#11
|
Banned
Join Date: May 2002
Location: Blackburn
Posts: 897
|
Re: Change to Scan IDs
I'd guess to make it even harder (re: so very unlikely that alliance techs wont consider wasting time trying) to randomly guess scan-links to 'steal' scans? Liklihood of succeeding in guessing a 10-digit alphanumeric id is same as guessing a ~15-digit numerical one. And shorter ids look nicer. Probably other reasons too
I like this move by pa! Don't get why cin is getting mild abuse for it, but I guess that's to be expected from the pa community.
|
|
|
9 Jan 2009, 14:23
|
#12
|
Insomniac
Join Date: May 2003
Posts: 3,583
|
Re: Change to Scan IDs
Quote:
Originally Posted by Newt
Liklihood of succeeding in guessing a 10-digit alphanumeric id is same as guessing a ~15-digit numerical one. And shorter ids look nicer. Probably other reasons too
|
Probability of guessing a 10 character alphanumeric ( case insensitive ) : 1 / 36^10 = 1 / 3656158440062976
Probability of guessing a 10 character alphanumeric ( case sentitive ) : 1 / 62^10 = 1 / 839299365868340224
Probability of guessing a 15 character numeric : 1 / 10^15 = 1/ 1000000000000000
They really arent similar
|
|
|
9 Jan 2009, 14:38
|
#13
|
Banned
Join Date: May 2002
Location: Blackburn
Posts: 897
|
Re: Change to Scan IDs
Wow! there's 26 letters in the alphabet... I was using 24, shudda paid more attention to GCSE english innit.
1/ 1000000000000000
1 / 3656158440062976
And they are more than comparable when you're discussing orders of magnitude Granted I didn't think of case sensitivity.
|
|
|
9 Jan 2009, 15:57
|
#14
|
mz.
Join Date: Aug 2005
Posts: 8,587
|
Re: Change to Scan IDs
If that is really the reason, you're solving a problem that doesn't even exist. No sane human being is going to bother finding scans in a pool of 2^32 IDs, especially when you keep in mind that it serves no practical good whatsoever.
__________________
The outraged poets threw sticks and rocks over the side of the bridge. They were all missing Mary and he felt a contented smug feeling wash over him. He would have given them a coy little wave if the roof hadn't collapsed just then. Mary then found himself in the middle of an understandably shocked family's kitchen table. So he gave them the coy little wave and realized it probably would have been more effective if he hadn't been lying on their turkey.
|
|
|
9 Jan 2009, 16:05
|
#15
|
Gabba gabba hey hey
Join Date: Aug 2008
Posts: 212
|
Re: Change to Scan IDs
Quote:
Originally Posted by Mzyxptlk
If that is really the reason, you're solving a problem that doesn't even exist. No sane human being is going to bother finding scans in a pool of 2^32 IDs, especially when you keep in mind that it serves no practical good whatsoever.
|
Apparently there have been attempts.
|
|
|
9 Jan 2009, 16:10
|
#16
|
mz.
Join Date: Aug 2005
Posts: 8,587
|
Re: Change to Scan IDs
I don't care, it's useless?
__________________
The outraged poets threw sticks and rocks over the side of the bridge. They were all missing Mary and he felt a contented smug feeling wash over him. He would have given them a coy little wave if the roof hadn't collapsed just then. Mary then found himself in the middle of an understandably shocked family's kitchen table. So he gave them the coy little wave and realized it probably would have been more effective if he hadn't been lying on their turkey.
|
|
|
9 Jan 2009, 16:42
|
#17
|
Banned
Join Date: May 2002
Location: Blackburn
Posts: 897
|
Re: Change to Scan IDs
I think pa are just trying to get people to stop attempting it (whether they succeed or not, the server is still getting bombarded). So decreasing the chances of guessing correctly by vast orders of magnitude should help deter the idiots.
|
|
|
9 Jan 2009, 19:49
|
#18
|
Insomniac
Join Date: May 2003
Posts: 3,583
|
Re: Change to Scan IDs
tbh i would go the other way and generate a fake scan for those bombarding it with urls - just to mess with them.
|
|
|
9 Jan 2009, 21:49
|
#19
|
Banned
Join Date: Jul 2003
Location: ******
Posts: 2,326
|
Re: Change to Scan IDs
Afaik (no word from Cin if this is the reason) there is a weakness in the current ID generation, and it is possible to 'steal' some scans in some fashion.
|
|
|
10 Jan 2009, 15:02
|
#20
|
Insomniac
Join Date: May 2003
Posts: 3,583
|
Re: Change to Scan IDs
it boggles the mind as to how on earth something which should be as simple as a random number can be implemented wrong
|
|
|
10 Jan 2009, 18:08
|
#21
|
Banned
Join Date: Jul 2003
Location: ******
Posts: 2,326
|
Re: Change to Scan IDs
Quote:
Originally Posted by Phil^
it boggles the mind as to how on earth something which should be as simple as a random number can be implemented wrong
|
My guess is that they reseed it on every call with the current time.
|
|
|
10 Jan 2009, 18:55
|
#22
|
PA Team
Join Date: Apr 2004
Posts: 1,874
|
Re: Change to Scan IDs
Quote:
Originally Posted by Banned
My guess is that they reseed it on every call with the current time.
|
no we don't, it's a totally randomly generated numerical value, or was anyway.
ID change has been made, it applies both to scan and stored news IDs.
Both are a 15 char long alnum, so the urls and bbcode tags look like this:
show_news.pl?id=4s7hs81rladx2au
showscan.pl?scan_id=3vfbj73gleoihab
[scan]3vfbj73gleoihab[/scan]
__________________
Requested: 1,000 kilometres of fulcrum cable, 1 Mark 5 ECM unit, one low yield nuclear weapon.
Purpose: Surprise party for foreign dignitary
|
|
|
10 Jan 2009, 19:04
|
#23
|
Insomniac
Join Date: May 2003
Posts: 3,583
|
Re: Change to Scan IDs
those samples dont look case sensitive to me, does the implementation include capitals as well?
|
|
|
11 Jan 2009, 09:54
|
#24
|
CRASHING BEATS 'N FANTASY
Join Date: Mar 2001
Location: Cold Country.
Posts: 1,912
|
Re: Change to Scan IDs
Quote:
Originally Posted by Phil^
it boggles the mind as to how on earth something which should be as simple as a random number can be implemented wrong
|
You might want to read Knuth and then reconsider whether a "random" number is simple or not. Granted, in this case there are quite a few less constraints on the "random" number's quality, but ultimately it is not easy to get good "random" results.
Quote:
Originally Posted by Cincinnatus
no we don't, it's a totally randomly generated numerical value, or was anyway.
|
I recommend you read up on how "random" numbers are computed.
__________________
Ią! Ią! Munin F'tagn! - [*scendancy]
|
|
|
11 Jan 2009, 14:10
|
#25
|
Insomniac
Join Date: May 2003
Posts: 3,583
|
Re: Change to Scan IDs
Quote:
Originally Posted by Heartless
You might want to read Knuth and then reconsider whether a "random" number is simple or not.
|
Im assuming they are using perls rand() funct , which seeds on first use if not done already. Its hard to mess up if you are using a single function call without deliberately sabotaging your own efforts by reseeding
http://perl.active-venture.com/pod/func/srand.html
Quote:
Most programs won't even call srand() at all, except those that need a cryptographically-strong starting point rather than the generally acceptable default, which is based on time of day, process ID, and memory allocation, or the /dev/urandom device, if available.
|
On the servers, /dev/urandom should be available - plus the process id and memory allocation states should not be externally available to compromise the entropy pool
|
|
|
11 Jan 2009, 14:17
|
#26
|
CRASHING BEATS 'N FANTASY
Join Date: Mar 2001
Location: Cold Country.
Posts: 1,912
|
Re: Change to Scan IDs
Quote:
Originally Posted by Phil^
*snip*
|
Thanks for quoting the perl documentation, now go back and read Knuth to understand what I tried to tell you. It's in Volume Two of TAOCP.
__________________
Ią! Ią! Munin F'tagn! - [*scendancy]
|
|
|
11 Jan 2009, 16:37
|
#27
|
mz.
Join Date: Aug 2005
Posts: 8,587
|
Re: Change to Scan IDs
Thing is though, even if it's not perfectly random, it doesn't really matter, because the vulnerable information is of little to no value. So instead of wasting time on coding shit like this, perhaps it would be a good idea to,oh, I dunno, improve the game?
__________________
The outraged poets threw sticks and rocks over the side of the bridge. They were all missing Mary and he felt a contented smug feeling wash over him. He would have given them a coy little wave if the roof hadn't collapsed just then. Mary then found himself in the middle of an understandably shocked family's kitchen table. So he gave them the coy little wave and realized it probably would have been more effective if he hadn't been lying on their turkey.
|
|
|
11 Jan 2009, 19:32
|
#28
|
Banned
Join Date: Jul 2003
Location: ******
Posts: 2,326
|
Re: Change to Scan IDs
Quote:
Originally Posted by Cincinnatus
no we don't, it's a totally randomly generated numerical value, or was anyway.
ID change has been made, it applies both to scan and stored news IDs.
Both are a 15 char long alnum, so the urls and bbcode tags look like this:
show_news.pl?id=4s7hs81rladx2au
showscan.pl?scan_id=3vfbj73gleoihab
[scan]3vfbj73gleoihab[/scan]
|
I hope this was done with good reason. It sucks.
|
|
|
11 Jan 2009, 20:59
|
#29
|
Gabba gabba hey hey
Join Date: Aug 2008
Posts: 212
|
Re: Change to Scan IDs
Quote:
Originally Posted by Mzyxptlk
Thing is though, even if it's not perfectly random, it doesn't really matter, because the vulnerable information is of little to no value. So instead of wasting time on coding shit like this, perhaps it would be a good idea to,oh, I dunno, improve the game?
|
Agreed tbpfh.
"ZOMG I stole a scan done 4 ticks ago on a planet with 2 distorters, I'm so l33t"
|
|
|
12 Jan 2009, 00:04
|
#30
|
Ex-Head Multihunter
Join Date: Sep 2003
Location: At home
Posts: 900
|
Re: Change to Scan IDs
Quote:
Originally Posted by Banned
I hope this was done with good reason. It sucks.
|
it sucks? it's about 1 minute of recoding to fix a parser....
I don't see the problem.
__________________
R02.0-R4.0: [noob]
R05.0: [Wrath]/[Fury]
R06.0: Quit after 1 week
R7-9: Had an account, but didnt play seriously
R09.5: []LCH[] Officer
R10.0: []LCH[] HC (Rank #9, #1 Gal)
R10.5-R18.0: []LCH[] HC Scanner!
R18.0-R33 : Multihunter, Head MH
R34-.. : [CT] HC
|
|
|
|
All times are GMT +1. The time now is 03:52.
| |