mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Refactor SettingsUI and related modules
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// PersistentStringHash.h
|
||||
// PersistentStringHash
|
||||
//
|
||||
// Created by Peter on 8/17/19.
|
||||
// Copyright © 2019 Telegram Messenger LLP. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
//! Project version number for PersistentStringHash.
|
||||
FOUNDATION_EXPORT double PersistentStringHashVersionNumber;
|
||||
|
||||
//! Project version string for PersistentStringHash.
|
||||
FOUNDATION_EXPORT const unsigned char PersistentStringHashVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <PersistentStringHash/PublicHeader.h>
|
||||
|
||||
|
||||
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