commit d0e26509cbf0afffb27301a3e81821ded8bffb0d parent 2e973a51b5a4f1255416b35a16b793a166848f2b Author: rhunk <101876869+rhunk@users.noreply.github.com> Date: Sun, 24 Sep 2023 11:19:28 +0200 fix(proto_reader): proto pretty print uuid string Diffstat:
M | core/src/main/kotlin/me/rhunk/snapenhance/core/util/protobuf/ProtoReader.kt | | | 8 | ++++---- |
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/util/protobuf/ProtoReader.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/util/protobuf/ProtoReader.kt @@ -225,11 +225,11 @@ class ProtoReader(private val buffer: ByteArray) { // auto detect uuids if (array.size == 16) { val longs = LongArray(2) - for (i in 0..7) { - longs[0] = longs[0] or ((array[i].toLong() and 0xFF) shl (i * 8)) + for (i in 0 .. 7) { + longs[0] = longs[0] or ((array[i].toLong() and 0xFF) shl ((7 - i) * 8)) } - for (i in 8..15) { - longs[1] = longs[1] or ((array[i].toLong() and 0xFF) shl ((i - 8) * 8)) + for (i in 8 .. 15) { + longs[1] = longs[1] or ((array[i].toLong() and 0xFF) shl ((15 - i) * 8)) } stringBuilder.append("uuid: ${UUID(longs[0], longs[1])}\n") return@runCatching