Hi,
I'm trying to increase my understanding of this codebase, and while doing so, I stumbled upon the following inconsistency. In the following snippet, i in lowercase is for a signed int.
|
def decode_tag(data): |
|
latitude = struct.unpack(">i", data[0:4])[0] / 10000000.0 |
|
longitude = struct.unpack(">i", data[4:8])[0] / 10000000.0 |
Meanwhile, in the web app, the same bytes get decoded as an Uint:
|
static FindMyLocationReport _decodePayload( |
|
Uint8List payload, FindMyReport report) { |
|
final latitude = payload.buffer.asByteData(0, 4).getUint32(0, Endian.big); |
|
final longitude = payload.buffer.asByteData(4, 4).getUint32(0, Endian.big); |
So, I don't get it. Are both of these approaches valid because lat/long don't ever get high enough, or is one of these going to lead to a bug?
Thanks a lot!
Hi,
I'm trying to increase my understanding of this codebase, and while doing so, I stumbled upon the following inconsistency. In the following snippet,
iin lowercase is for a signed int.macless-haystack/endpoint/register/apple_cryptography.py
Lines 30 to 32 in 0bda271
Meanwhile, in the web app, the same bytes get decoded as an Uint:
macless-haystack/macless_haystack/lib/findMy/decrypt_reports.dart
Lines 73 to 76 in 0bda271
So, I don't get it. Are both of these approaches valid because lat/long don't ever get high enough, or is one of these going to lead to a bug?
Thanks a lot!