Skip to content

Commit 4c9464b

Browse files
authored
Convert bytes directly to Data instead of UnsafePointer API (#83)
* Convert bytes directly to Data instead of UnsafePointer API Using a pointer to an array created via the UnsafePointer initializer is undefined and isn't guaranteed to be valid. * Use non-deprecated initializer for Data
1 parent 440f78d commit 4c9464b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/CryptorRSA/CryptorRSAUtilities.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public extension CryptorRSA {
286286
index += 1
287287

288288
let strippedKeyBytes = [UInt8](byteArray[index...keyData.count - 1])
289-
let data = Data(bytes: UnsafePointer<UInt8>(strippedKeyBytes), count: keyData.count - index)
289+
let data = Data(strippedKeyBytes)
290290
return data
291291
}
292292

0 commit comments

Comments
 (0)