//// VIEwController.swift// learn//// Created by myhaspl on 16/1/26.// copyright (c) 2016年 myhaspl. All rights reserved.//import Cocoaclass VIEwController: NSVIEwController { overrIDe func vIEwDIDLoad() { super.vIEwDIDLoad() // Do any additional setup after loading the vIEw. } overrIDe var representedobject: AnyObject? { dIDSet { // Update the vIEw,if already loaded. } } @IBOutlet weak var hashresult: NSTextFIEld! @IBOutlet weak var sourcestr: NSTextFIEld! @IBAction func hashbutton(sender: AnyObject) { let sourcestring=sourcestr.stringValue var hashres:Int64=1 var str:String for charascii in sourcestring.utf8{ str="\(charascii)" hashres = str.toInt()! + 33 * hashres } hashresult.stringValue=String(hashres) }}
字符串HASH
总结以上是内存溢出为你收集整理的swift手记-6全部内容,希望文章能够帮你解决swift手记-6所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)