-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
60 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# sumHash | ||
|
||
Calculate a hash sum for a given value. The hash is generated based on the value's properties and content, and it returns a hexadecimal string representation of the hash. | ||
|
||
### Usage | ||
|
||
```ts | ||
import { sumHash } from 'rattail' | ||
|
||
sumHash('123') | ||
// return '1a3a267c' | ||
sumHash({ a: '123' }) | ||
// return 'b1c920ac' | ||
``` | ||
|
||
### Arguments | ||
|
||
| Arg | Type | Defaults | | ||
| ------- | :---: | -------: | | ||
| `value` | `any` | | | ||
|
||
### Return | ||
|
||
| Type | | ||
| :------: | | ||
| `string` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# sumHash | ||
|
||
为给定的值计算一个哈希值。哈希值是基于值的属性和内容生成的,并返回哈希的十六进制字符串表示。 | ||
|
||
### 使用 | ||
|
||
```ts | ||
import { sumHash } from 'rattail' | ||
|
||
sumHash('123') | ||
// return '1a3a267c' | ||
sumHash({ a: '123' }) | ||
// return 'b1c920ac' | ||
``` | ||
|
||
### 参数列表 | ||
|
||
| 参数 | 类型 | 默认值 | | ||
| ------- | :---: | -----: | | ||
| `value` | `any` | | | ||
|
||
### 返回值 | ||
|
||
| 类型 | | ||
| :------: | | ||
| `string` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
### 用法 | ||
|
||
```ts | ||
import mitt from 'mitt' | ||
import { mitt } from 'rattail' | ||
|
||
const emitter = mitt() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters