baldeau 3b4fb7f85c
Some checks failed
xiao_pet_tracker / semantic-pull-request (push) Failing after 0s
xiao_pet_tracker / build (push) Failing after 0s
xiao_pet_tracker / spell-check (push) Failing after 0s
release 1.0
2024-11-13 21:22:29 +01:00

33 lines
539 B
Dart

import 'dart:typed_data';
int fromBytesToInt32(int b3, int b2, int b1, int b0) {
final int8List = Int8List(4)
..[3] = b3
..[2] = b2
..[1] = b1
..[0] = b0;
return int8List.buffer.asByteData().getInt32(0);
}
int fromBytesToInt64(
int b7,
int b6,
int b5,
int b4,
int b3,
int b2,
int b1,
int b0,
) {
final int8List = Int8List(8)
..[7] = b7
..[6] = b6
..[5] = b5
..[4] = b4
..[3] = b3
..[2] = b2
..[1] = b1
..[0] = b0;
return int8List.buffer.asByteData().getInt64(0);
}