Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 5 #18

Closed
enjijon opened this issue Mar 26, 2019 · 5 comments
Closed

Swift 5 #18

enjijon opened this issue Mar 26, 2019 · 5 comments
Assignees

Comments

@enjijon
Copy link

enjijon commented Mar 26, 2019

file: cordova-plugin-aes256-encryption/PBKDF2.swift
warning: 'withUnsafeBytes' is deprecated: use withUnsafeBytes<R>(_: (UnsafeRawBufferPointer) throws -> R) rethrows -> R instead
saltData.withUnsafeBytes

I need help in understanding the new withUnsafeBytes format. For now I can only build with swift 4. But i would like to build in Swift 5 too.

@alobanov
Copy link

alobanov commented Apr 1, 2019

To fix the warning, use new method like this:

let result: OSStatus = data.withUnsafeMutableBytes({ bytes -> OSStatus in
      SecRandomCopyBytes(
             kSecRandomDefault, 
             kCCKeySizeAES256 * 2, 
             bites.bindMemory(to: UInt8.self).baseAddress!)
    })

@pandiarajan-i2i
Copy link
Contributor

Thanks, @alobanov,

Currently, we are working on the Swift versions(3,4,5) support. Your changes will come as part of this.

@pandiarajan-i2i
Copy link
Contributor

It will be covered as part of the pull request #22

@pandiarajan-i2i
Copy link
Contributor

@enjijon , @alobanov ,

This issue has been fixed and we have released the new version 2.0.0. Please use the latest version and let us know if any issues.

@pandiarajan-i2i
Copy link
Contributor

Fixed as the part of #22

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

No branches or pull requests

4 participants