mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
13 lines
287 B
Swift
13 lines
287 B
Swift
import Foundation
|
|
|
|
public extension String {
|
|
var persistentHashValue: UInt64 {
|
|
var result = UInt64 (5381)
|
|
let buf = [UInt8](self.utf8)
|
|
for b in buf {
|
|
result = 127 * (result & 0x00ffffffffffffff) + UInt64(b)
|
|
}
|
|
return result
|
|
}
|
|
}
|