From 336a9224122483895af998b291b57792ee553ea7 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Wed, 9 Nov 2022 14:26:17 -0600 Subject: [PATCH] Fix bug in hex encoding of normalized constraint hashes (#315) --- Sources/MySQLKit/MySQLDialect.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MySQLKit/MySQLDialect.swift b/Sources/MySQLKit/MySQLDialect.swift index e0f4152..aa77df3 100644 --- a/Sources/MySQLKit/MySQLDialect.swift +++ b/Sources/MySQLKit/MySQLDialect.swift @@ -88,6 +88,6 @@ public struct MySQLDialect: SQLDialect { fileprivate let hexTable: [UInt8] = [0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66] extension Sequence where Element == UInt8 { fileprivate var hexRepresentation: String { - .init(decoding: self.flatMap { [hexTable[Int($0 >> 4)], hexTable[Int($0 & 0x7)]] }, as: Unicode.ASCII.self) + .init(decoding: self.flatMap { [hexTable[Int($0 >> 4)], hexTable[Int($0 & 0xf)]] }, as: Unicode.ASCII.self) } }