项目作者: luaVolk

项目描述 :
ADLER-32 checksum in Dart
高级语言: Dart
项目地址: git://github.com/luaVolk/ADLER32.git
创建时间: 2018-12-24T01:55:05Z
项目社区:https://github.com/luaVolk/ADLER32

开源协议:Other

下载


ADLER32 Pub

Port of SheetJS’ adler32 written in Dart.

Instalation

  1. $ pub get adler32

Usage

Importing this library exposes the class Adler32 which contains 3 functions.

buf

int buf(List<int> buf, [int seed])

The buf function takes an array of bytes as the first argument

Example
  1. Adler32.buf([65,121,121,32,108,109,97,111,33,33,33]) // 381289312

bstr

int bstr(String bstr, [int seed])

The bstr function takes a binary string the first argument

Example
  1. Adler32.bstr("Ayy lmao!!!") // 381289312

str

int str(String str, [int seed])

The str function takes a string the first argument

Example
  1. Adler32.str("Ayy lmao!!!") // 381289312

Using seed

All 3 functions take a second optional argument for the starting “seed”

  1. int adler32 = Adler32.buf([65, 121, 121]); // 36766004 "Ayy"
  2. adler32 = Adler32.str(" lmao", adler32); // 217907965 "Ayy lmao"
  3. Adler32.bstr("!!!", adler32); // 381289312 "Ayy lmao!!!"

License

Apache 2.0 License