Port of SheetJS' adler32 written in Dart.
$ pub get adler32
Importing this library exposes the class Adler32
which contains 3 functions.
int buf(List<int> buf, [int seed])
The buf
function takes an array of bytes as the first argument
Adler32.buf([65,121,121,32,108,109,97,111,33,33,33]) // 381289312
int bstr(String bstr, [int seed])
The bstr
function takes a binary string the first argument
Adler32.bstr("Ayy lmao!!!") // 381289312
int str(String str, [int seed])
The str
function takes a string the first argument
Adler32.str("Ayy lmao!!!") // 381289312
All 3 functions take a second optional argument for the starting "seed"
int adler32 = Adler32.buf([65, 121, 121]); // 36766004 "Ayy"
adler32 = Adler32.str(" lmao", adler32); // 217907965 "Ayy lmao"
Adler32.bstr("!!!", adler32); // 381289312 "Ayy lmao!!!"