Results 1 to 10 of 42
Threaded View
-
1st Jul 2012, 06:41 PM #23OPRespected DeveloperWebsite's:
X4B.orgThat almost makes me spew as much as.
Code:Public Function Adler32$(data As StringReader, Optional InitL& = 1, Optional InitH& = 0) With data Dim L&, h& h = InitH: L = InitL Dim StrCharPos&, tmpBuff$ tmpBuff = StrConv(.mvardata, vbFromUnicode, LocaleID_ENG) 'The largest prime less than 2^16 L = (AscB(MidB$(tmpBuff, StrCharPos, 1)) + L) ' Mod 65521 '&HFFF1 h = (h + L) ' Mod 65521 '&HFFF1 If (0 = (StrCharPos Mod 5552)) Or _ (StrCharPos = Len(.mvardata)) Then L = L Mod 65521 '&HFFF1 h = h Mod 65521 '&HFFF1 myDoEvents End If Next Adler32 = H16(h) & H16(L) End With End Function
Code:static public uint adler32(byte[] data, int len){ ulong a = 17; ulong b = 0; ulong MOD_ADLER = 65521; for(int i = 0; i < len; ++i){ a = (a + data[i]) % MOD_ADLER; b = (b + a) % MOD_ADLER; } return (uint)((b << 16) | a); }
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Plz Help To Add A Php Snippet Into My DLE Index !
By JoomlaZ in forum Web Development AreaReplies: 0Last Post: 7th Jul 2011, 01:18 PM -
[C#] Tiny Web Server (snippet)
By Hyperz in forum Web Development AreaReplies: 6Last Post: 24th Jun 2010, 01:19 PM -
Image Upload in php. Code snippet #2
By SplitIce in forum Tutorials and GuidesReplies: 5Last Post: 31st Oct 2009, 07:40 AM -
See real OOP (Snippet from Litewarez V2) Webmasters CP
By litewarez in forum Tutorials and GuidesReplies: 21Last Post: 19th Sep 2009, 03:59 PM -
A Snippet from my latest project
By litewarez in forum Tutorials and GuidesReplies: 19Last Post: 21st Jun 2009, 05:17 PM
themaCreator - create posts from...
Version 3.52 released. Open older version (or...