mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-17 11:00:07 +00:00
19 lines
427 B
Swift
19 lines
427 B
Swift
import Foundation
|
|
import TelegramCorePrivateModule
|
|
#if os(macOS)
|
|
import PostboxMac
|
|
#else
|
|
import Postbox
|
|
#endif
|
|
|
|
public extension MemoryBuffer {
|
|
public func md5Digest() -> Data {
|
|
var res = Data()
|
|
res.count = Int(CC_MD5_DIGEST_LENGTH)
|
|
res.withUnsafeMutableBytes { mutableBytes -> Void in
|
|
CC_MD5(self.memory, CC_LONG(self.length), mutableBytes)
|
|
}
|
|
return res
|
|
}
|
|
}
|