mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Refactor SettingsUI and related modules
This commit is contained in:
12
submodules/PersistentStringHash/Sources/StringHash.swift
Normal file
12
submodules/PersistentStringHash/Sources/StringHash.swift
Normal file
@@ -0,0 +1,12 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user