This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Self Bluetooth mac address by | |
UIDevice.current.identifierForVendor?.uuidString | |
Inside didDiscover delegate you will have a peripheral with id | |
peripheral.identifier.uuidString |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileprivate func encryptionAES(data: Data, key: Data, IV: Data) -> String? { | |
var numberOfBytesEncrypted : size_t = 0 | |
let size = data.count + kCCKeySizeAES128 | |
var encrypted = Data(count: size) | |
let cryptStatus = IV.withUnsafeBytes { ivBytes in | |
encrypted.withUnsafeMutableBytes { encryptedBytes in | |
data.withUnsafeBytes { dataBytes in | |
key.withUnsafeBytes { keyBytes in | |
CCCrypt(CCOperation(kCCEncrypt), CCAlgorithm(kCCAlgorithmAES), CCOptions(kCCOptionPKCS7Padding), keyBytes, key.count, ivBytes, dataBytes, data.count, encryptedBytes, size, &numberOfBytesEncrypted) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm start -- --reset-cache |
OlderNewer