⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hash-string.sml

📁 这是我们参加06年全国开源软件的竞赛作品
💻 SML
字号:
(* hash-string.sml * * COPYRIGHT (c) 1992 by AT&T Bell Laboratories *)structure HashString : sig    val hashString : string -> word  end = struct    fun charToWord c = Word.fromInt(Char.ord c)  (* A function to hash a character.  The computation is:   *   *   h = 33 * h + 720 + c   *)    fun hashChar (c, h) = Word.<<(h, 0w5) + h + 0w720 + (charToWord c)(* NOTE: another function we might try is h = 5*h + c, which is used * in STL. *)    fun hashString s = CharVector.foldl hashChar 0w0 s	    end (* HashString *)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -