home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.compilers      Compiler construction, theory, etc. (Mod      2,753 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,614 of 2,753   
   glen herrmannsfeldt to Eric Fowler   
   Re: How to get at the entire input buffe   
   29 Mar 09 19:34:24   
   
   From: gah@ugcs.caltech.edu   
      
   Eric Fowler  wrote:   
   (snip)   
      
   > The *XX field is a single byte checksum calculated from the rest of   
   > the string up to that point.   
      
   > I am looking for a nice clean way of checking the sum within either   
   > the parser or the lexer, that is, calculating the checksum from the   
   > whole string and comparing it to the value I got embedded in the   
   > string itself.   
      
   Many checksums are designed such that, when computed over   
   the whole string including the checksum character,   
   the result is a known constant, usually zero or ~0.   
      
   That avoids the need for a special check for the last   
   character and a compare operation, but it may or   
   may not help in your caes.   
      
   -- glen   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca