Skip to content

Commit

Permalink
feat: more hex utils
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Dec 13, 2024
1 parent 16d13e2 commit c80674a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/src/hex_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension TekartikUint8ListToHexExt on Uint8List {
/// Convert to hex
extension TekartikUint32ToHexExt on int {
/// Convert 1,2,3 to 010203
String uint32ToHex() {
String uint32ToHexString() {
return uint32ToUint8List().toHexString();
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: tekartik_common_utils
version: 0.15.16
version: 0.15.17
description: Common pure dart utilities (not io or browser dependant)
homepage: https://github.com/tekartik/common_utils.dart
publish_to: none
Expand Down
6 changes: 3 additions & 3 deletions test/hex_utils_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ void main() {
expect(toLohexString(null), null);
});
test('int extension', () {
expect(0x1234.uint32ToHex(), '00001234');
expect(0x1234.uint32ToHexString(), '00001234');
expect(0x123456aF.uint32ToUint8List(), [0x12, 0x34, 0x56, 0xaf]);
expect(0x1234.uint32ToHex(), '00001234');
expect(0x123f.uint32ToHex(), '0000123F');
expect(0x1234.uint32ToHexString(), '00001234');
expect(0x123f.uint32ToHexString(), '0000123F');
expect('123456eF'.hexParseUint32(), 0x123456ef);
expect('1234cD'.hexParseUint8List(), [0x12, 0x34, 0xcD]);
expect(asUint8List([0x12, 0x34, 0x56, 0xaf]).toHexString(), '123456AF');
Expand Down

0 comments on commit c80674a

Please sign in to comment.