Skip to content

Use Array(data) instead of Data.bytes to support newer CryptoSwift (#79)#81

Merged
marionbarker merged 1 commit into
devfrom
main
Jun 13, 2026
Merged

Use Array(data) instead of Data.bytes to support newer CryptoSwift (#79)#81
marionbarker merged 1 commit into
devfrom
main

Conversation

@marionbarker

Copy link
Copy Markdown
Contributor

This commit was merged into main. This PR updates it to dev.

See #79 and #78

…ity (#79)

CryptoSwift 1.9.0 removed its `Data.bytes -> [UInt8]` extension (renamed
to `byteArray`). On the Xcode 26 SDK, `data.bytes` then resolves to
Foundation's new native `Data.bytes`, which returns a `RawSpan` -
breaking every crypto call site with errors like:

  Cannot convert value of type 'RawSpan' to expected argument type 'Array<UInt8>'
  Value of type 'RawSpan' has no member 'toHexString'

Builds pinned to CryptoSwift <= 1.8.5 are unaffected, so this only bites
users whose package resolution floats up to 1.9.0/1.10.0 (e.g. after
'Update to Latest Package Versions').

Replace `<data>.bytes` with `Array(<data>)`, which yields the same
[UInt8] and compiles against every CryptoSwift version (and doesn't
depend on CryptoSwift at all). Verified building OmnipodKit against
CryptoSwift 1.10.0 on Xcode 26.5.

Co-authored-by: Pete Schwamb <pschwamb@gmail.com>
@marionbarker marionbarker requested a review from itsmojo as a code owner June 12, 2026 22:30

@itsmojo itsmojo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marionbarker marionbarker merged commit 88966ea into dev Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants