Skip to content

Commit 5247300

Browse files
committed
Fix typo: Alder is renamed to Adler
1 parent 02285ac commit 5247300

File tree

12 files changed

+46
-40
lines changed

12 files changed

+46
-40
lines changed

.github/workflows/release-test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ jobs:
3737
sdk: ['stable', '2.19', 'beta']
3838
platform: ['vm', 'node']
3939
exclude:
40-
# skip test for beta
4140
- sdk: 'beta'
4241
os: macos-latest
4342
- sdk: 'beta'
4443
os: windows-latest
45-
- sdk: 'beta'
46-
platform: 'node'
47-
# Skip node platform
44+
- platform: 'node'
45+
sdk: 'beta'
4846
- platform: 'node'
4947
sdk: '2.19'
5048
os: macos-latest

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 2.2.0
2+
3+
- Fixes typo: Alder is renamed to Adler
4+
15
# 2.1.0
26

37
- Enhances the CRCs with custom polynomial support.
@@ -316,7 +320,7 @@
316320
- Adds `PBKDF2` key derivator.
317321
- Adds extension to `HMAC` to create `PBKDF2` instance.
318322
- Define `MACHashBase` and `MACSinkBase` for Message Authentication Code generators.
319-
- Reset features for `crc16`, `crc32`, `crc64`, `alder32`, and `hmac` internal sinks.
323+
- Reset features for `crc16`, `crc32`, `crc64`, `adler32`, and `hmac` internal sinks.
320324
- Enhance `blake2b` and `blake2s` for MAC generation
321325
- **Breaking change**:
322326
- Accept number of bytes instead of bits for `Blake2b` and `Blake2s`
@@ -386,7 +390,7 @@
386390
- `crc16`
387391
- `crc32`
388392
- `crc64`
389-
- `alder32`
393+
- `adler32`
390394

391395
# 1.1.0
392396

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
This library contains implementations of secure hash functions, checksum generators, and key derivation algorithms optimized for Dart.
1212

13-
## Depencencies
13+
## Dependencies
1414

1515
There is only 1 dependency used by this package:
1616

@@ -68,7 +68,7 @@ There is only 1 dependency used by this package:
6868
| Algorithms | Available methods | Source |
6969
| ---------- | ------------------------- | --------- |
7070
| CRC | `crc16`, `crc32`, `crc64` | Wikipedia |
71-
| Alder32 | `alder32` | Wikipedia |
71+
| Adler32 | `adler32` | Wikipedia |
7272

7373
### Random Algorithm
7474

@@ -118,7 +118,7 @@ Check the [API Reference](https://pub.dev/documentation/hashlib/latest/) for det
118118

119119
Examples can be found inside the `example` folder.
120120

121-
### Hashilb Example
121+
### Hashlib Example
122122

123123
```dart
124124
import 'package:hashlib/codecs.dart';
@@ -140,7 +140,7 @@ void main() {
140140
// Example of hash-code generations
141141
print('XXH32 => ${xxh32code(text)}');
142142
print('CRC32 => ${crc32code(text)}');
143-
print('Alder32 => ${alder32code(text)}');
143+
print('Adler32 => ${adler32code(text)}');
144144
print('CRC16 => ${crc16code(text)}');
145145
print('');
146146
@@ -171,7 +171,7 @@ void main() {
171171
print('SHAKE-256 => ${shake256.of(20).string(text)}');
172172
print('BLAKE2s-256 => ${blake2s256.string(text)}');
173173
print('BLAKE2b-512 => ${blake2b512.string(text)}');
174-
print('SM3] => ${sm3.string(text)}');
174+
print('SM3 => ${sm3.string(text)}');
175175
print('');
176176
177177
// Examples of MAC generations

example/hashlib_example.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void main() {
1717
// Example of hash-code generations
1818
print('XXH32 => ${xxh32code(text)}');
1919
print('CRC32 => ${crc32code(text)}');
20-
print('Alder32 => ${alder32code(text)}');
20+
print('Adler32 => ${adler32code(text)}');
2121
print('CRC16 => ${crc16code(text)}');
2222
print('');
2323

@@ -48,7 +48,7 @@ void main() {
4848
print('SHAKE-256 => ${shake256.of(20).string(text)}');
4949
print('BLAKE2s-256 => ${blake2s256.string(text)}');
5050
print('BLAKE2b-512 => ${blake2b512.string(text)}');
51-
print('SM3] => ${sm3.string(text)}');
51+
print('SM3 => ${sm3.string(text)}');
5252
print('');
5353

5454
// Examples of MAC generations

lib/hashlib.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
// Copyright (c) 2023, Sudipto Chandra
22
// All rights reserved. Check LICENSE file for details.
33

4-
/// Secure hash algorithms in pure dart.
4+
/// Collection of hashing algorithms, checksum generators, message
5+
/// authentication code (MAC) utilities and key derivation functions.
6+
///
7+
/// This library serves as a convenience export so that all supported
8+
/// algorithms can be used with a single import.
59
library;
610

711
export 'src/hashlib.dart';

lib/src/alder32.dart renamed to lib/src/adler32.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import 'dart:convert';
55

6-
import 'package:hashlib/src/algorithms/alder32.dart';
6+
import 'package:hashlib/src/algorithms/adler32.dart';
77
import 'package:hashlib/src/core/hash_base.dart';
88

99
/// [Adler-32][wiki] is composed of two sums accumulated per byte.
@@ -19,23 +19,23 @@ import 'package:hashlib/src/core/hash_base.dart';
1919
/// [wiki]: https://en.wikipedia.org/wiki/Adler-32
2020
///
2121
/// **WARNING: It should not be used for cryptographic purposes.**
22-
const HashBase alder32 = _Alder32();
22+
const HashBase adler32 = _Adler32();
2323

24-
class _Alder32 extends HashBase {
25-
const _Alder32();
24+
class _Adler32 extends HashBase {
25+
const _Adler32();
2626

2727
@override
2828
final String name = 'ALDER-32';
2929

3030
@override
31-
Alder32Hash createSink() => Alder32Hash();
31+
Adler32Hash createSink() => Adler32Hash();
3232
}
3333

34-
/// Gets the Alder-32 value of a String
34+
/// Gets the Adler-32 value of a String
3535
///
3636
/// Parameters:
3737
/// - [input] is the string to hash
3838
/// - The [encoding] is the encoding to use. Default is `input.codeUnits`
39-
int alder32code(String input, [Encoding? encoding]) {
40-
return alder32.string(input, encoding).number();
39+
int adler32code(String input, [Encoding? encoding]) {
40+
return adler32.string(input, encoding).number();
4141
}

lib/src/algorithms/alder32.dart renamed to lib/src/algorithms/adler32.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import 'dart:typed_data';
55

66
import 'package:hashlib/src/core/hash_base.dart';
77

8-
const int _alder32Mod = 65521;
8+
const int _adler32Mod = 65521;
99

1010
/// This implementation is derived from the [ ZLIB Compressed Data Format
1111
/// Specification version 3.3 ][rfc]
1212
///
1313
/// [rfc]: https://www.ietf.org/rfc/rfc1950.html
14-
class Alder32Hash extends HashDigestSink {
14+
class Adler32Hash extends HashDigestSink {
1515
int a = 1, b = 0;
1616

17-
Alder32Hash();
17+
Adler32Hash();
1818

1919
@override
2020
final int hashLength = 4;
@@ -29,8 +29,8 @@ class Alder32Hash extends HashDigestSink {
2929
@override
3030
void $process(List<int> chunk, int start, int end) {
3131
for (; start < end; start++) {
32-
a = (a + chunk[start]) % _alder32Mod;
33-
b = (b + a) % _alder32Mod;
32+
a = (a + chunk[start]) % _adler32Mod;
33+
b = (b + a) % _adler32Mod;
3434
}
3535
}
3636

lib/src/core/registry.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void _buildRegistry() {
3636
if (_hash.isNotEmpty) return;
3737

3838
_hash.addAll({
39-
_norm(alder32.name): alder32,
39+
_norm(adler32.name): adler32,
4040
_norm(crc16.name): crc16,
4141
_norm(crc32.name): crc32,
4242
_norm(crc64.name): crc64,

lib/src/hashlib.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) 2023, Sudipto Chandra
22
// All rights reserved. Check LICENSE file for details.
33

4-
export 'alder32.dart';
4+
export 'adler32.dart';
55
export 'argon2.dart';
66
export 'bcrypt.dart';
77
export 'blake2b.dart';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: hashlib
22
description: Secure hash functions, checksum generators, and key derivation algorithms optimized for Dart.
33
homepage: https://github.com/bitanon/hashlib
4-
version: 2.1.0
4+
version: 2.2.0
55

66
environment:
77
sdk: '>=2.19.0 <4.0.0'

0 commit comments

Comments
 (0)