import string;
const string WELCOME = "Hello, world!";
# Adler-32 is a checksum algorithm invented by Mark Adler in 1995.
function adler32 : string as message, int as messageLength;
const int MOD_ADLER = 65521;
string char;
int charValue;
int s1 = 1;
int s2 = 0;
int n = 0;
while n < messageLength;
call char_at : message, n -> char;
call char_to_int : char -> charValue;
s1 = (s1 + charValue) % MOD_ADLER;
s2 = (s2 + s1) % MOD_ADLER;
n += 1;
end;
s2 = (s2 << 16) | s1;
return s2;
int welcomeLength;
call length : WELCOME -> welcomeLength;
int hash;
call adler32 : WELCOME, welcomeLength -> hash;
-
Notifications
You must be signed in to change notification settings - Fork 0
Concert is an imperative, concurrent, strongly typed scripting language
License
puckowski/concert
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Concert is an imperative, concurrent, strongly typed scripting language
Topics
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published