hashSeed関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A seed from any text: hashSeed("room-7") is the same unsigned 32-bit
integer everywhere. FNV-1a over the UTF-16 code units, then MurmurHash3's
finaliser, so "a" and "b" land far apart. Use it to seed from a name, a
room code or a date string.
インポート
import { hashSeed } from "@johnmorrisdotca/tane";
定義
function hashSeed(text: string): number
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | Text to hash, validate or decode. |
戻り値
number
A seed from any text: hashSeed("room-7") is the same unsigned 32-bit integer everywhere. FNV-1a over the UTF-16 code units, then MurmurHash3's finaliser, so "a" and "b" land far apart. Use it to seed from a name, a room code or a date string.
例
import { hashSeed } from "@johnmorrisdotca/tane";
console.log(hashSeed("room-7"));948657874出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。