Skip to content

Commit

Permalink
preparing the package
Browse files Browse the repository at this point in the history
  • Loading branch information
rtmigo committed Mar 14, 2021
1 parent 5fc1947 commit 4e5d0f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
16 changes: 8 additions & 8 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Defines a default set of lint rules enforced for
# projects at Google. For details and rationale,
# see https://github.com/dart-lang/pedantic#enabled-lints.
# default set of lint rules enforced for projects at Google
# https://github.com/dart-lang/pedantic#enabled-lints
include: package:pedantic/analysis_options.yaml

# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
# Uncomment to specify additional rules.
# linter:
# rules:
# - camel_case_types
# http://dart-lang.github.io/linter/lints
linter:
rules:
omit_local_variable_types: false
await_only_futures: true

analyzer:
# exclude:
# - path/to/excluded/files/**

13 changes: 8 additions & 5 deletions lib/src/00_ints.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ extension BitInt on int {
// uint64 will shift all 64 of its bits,
// but int64 will shift lower 63 and preserve the highest bit

if (this >= 0)
if (this >= 0) {
return this >> shift;
}
else {
int x = this;
var x = this;
// setting highest bit to zero
x &= INT64_MAX_POSITIVE;
assert(x >= 0);
Expand All @@ -59,10 +60,11 @@ extension BitInt on int {
// uint64 will shift all 64 of its bits,
// but int64 will shift lower 63 and preserve the highest bit

if (this >= 0)
if (this >= 0) {
return this >> shift;
}
else {
int x = this;
var x = this;
// setting highest bit to zero
x &= INT64_MAX_POSITIVE;
assert(x >= 0);
Expand Down Expand Up @@ -93,8 +95,9 @@ extension BitInt on int {

String toHexUint64() {

if (this>=0)
if (this>=0) {
return this.toRadixString(16).toUpperCase().padLeft(16, '0');
}

int lower7bytes = this & INT64_LOWER_7_BYTES;
String strLow = lower7bytes.toRadixString(16).toUpperCase().padLeft(14, '0');
Expand Down

0 comments on commit 4e5d0f4

Please sign in to comment.