• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Validating the magic cookie number.

 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings.
How do I go about validating the magic cookie number? OK, I can read it in, but how do I know it's valid? Or not corrupted?
Tnx
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jacques,
It seems to me there are only two reasonable things to do.
1. Since the magic cookie value is not documented in the assignment (it wasn't in mine), you can assume that the magic cookie that's present in your sample database file is correct. Once you determine what it is, you can validate any database file by comparing it's magic cookie to this value.
2. You can come to the simplifying assumption that you can ignore the magic cookie value on the grounds that you don't really know much about it, and what you do know about it indicates that's it's not terribly important. Is there more than one valid magic cookie value? Who knows? It's not a must requirement in the assignment instructions, so you probably don't need to worry about it.
I choose 1, because I wanted to have very specific error messages and by making this assumption about the magic cookie it gave me an opportunity to do so. I have no special insight into whether this is the right way to do this. It made sense to me to make the assumption that the magic cookie in the provided database file is correct, and to use this information to validate the magic cookie value in other database files.
I think you can safely make either decision. In general, my opinion is that in this exam simplicity is rewarded much more than complexity. I wish I had followed my own advice on this point more than I did.
Hope this helps,
George
[ January 13, 2004: Message edited by: George Marinkovich ]
 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, thanx!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic