---
title: "simpleHash"
description: "Generate a fast non-cryptographic hash of a string as a base-36 encoded value, handy for cache keys and lightweight fingerprints."
canonical_url: "https://core.mhaibaraai.cn/en/docs/helpers/simple-hash"
---
# simpleHash

> Generate a fast non-cryptographic hash of a string as a base-36 encoded value, handy for cache keys and lightweight fingerprints.

## Usage

`simpleHash` generates a simple hash value for a string.

```ts
import { simpleHash } from '@movk/core'

const hash1 = simpleHash('hello world')
console.log(hash1) // 'nf5xd4'

const hash2 = simpleHash('hello world')
console.log(hash1 === hash2) // true — same string produces the same hash

const hash3 = simpleHash('hello world!')
console.log(hash1 === hash3) // false — different strings produce different hashes
```

## API

### `simpleHash(str)`

Generate a simple hash value for a string.

### Parameters

**str** (`string`) *required*: The string to hash.

### Returns

**returns** (`string`): The 32-bit hash value encoded as a base-36 string.

## Changelog

See commit history for [src/helpers/simpleHash.ts](https://github.com/mhaibaraai/movk-core/commits/main/src/helpers/simpleHash.ts).

---

- [GitHub](https://github.com/mhaibaraai/movk-core/blob/main/src/helpers/simpleHash.ts)


## Sitemap

See the full [sitemap](https://core.mhaibaraai.cn/sitemap.md) for all pages.
