修复声明
parent
a740ad2f73
commit
fae1ce2f15
|
@ -2,7 +2,7 @@
|
||||||
> 本模块是对原生的`crypto`模块二次封装的,在使用上更加简单方便。
|
> 本模块是对原生的`crypto`模块二次封装的,在使用上更加简单方便。
|
||||||
|
|
||||||
## 更新日志
|
## 更新日志
|
||||||
+ v3.3.2
|
+ v3.3.3
|
||||||
- 优化`.d.ts`参数声明
|
- 优化`.d.ts`参数声明
|
||||||
|
|
||||||
+ v3.3.1
|
+ v3.3.1
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "crypto.js",
|
"name": "crypto.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "3.3.2",
|
"version": "3.3.3",
|
||||||
"description": "原生crypto加密模块的二次封装,简化常用加密函数的使用",
|
"description": "原生crypto加密模块的二次封装,简化常用加密函数的使用",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"md5",
|
"md5",
|
||||||
|
|
|
@ -3,16 +3,17 @@
|
||||||
* @author yutent<yutent.io@gmail.com>
|
* @author yutent<yutent.io@gmail.com>
|
||||||
* @date 2024/12/12 15:41:25
|
* @date 2024/12/12 15:41:25
|
||||||
*/
|
*/
|
||||||
import crypto from 'crypto'
|
|
||||||
|
|
||||||
declare module 'crypto.js' {
|
declare module 'crypto.js' {
|
||||||
|
import crypto from 'node:crypto'
|
||||||
|
|
||||||
// 原生 crypto 模块
|
// 原生 crypto 模块
|
||||||
export const crypto: crypto
|
export { crypto }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated('use crypto instead')
|
* @deprecated Use `crypto` instead.
|
||||||
*/
|
*/
|
||||||
export const origin: crypto
|
export const origin: typeof crypto
|
||||||
|
|
||||||
// 随机数生成
|
// 随机数生成
|
||||||
export function rand(len: number, forceNum?: boolean): string
|
export function rand(len: number, forceNum?: boolean): string
|
||||||
|
@ -36,10 +37,6 @@ declare module 'crypto.js' {
|
||||||
|
|
||||||
export function sha256Sign(path: string, encode?: string): string | Buffer
|
export function sha256Sign(path: string, encode?: string): string | Buffer
|
||||||
|
|
||||||
export function sha1(data: string, encode?: string): string | Buffer
|
|
||||||
|
|
||||||
export function sha1Sign(path: string, encode?: string): string | Buffer
|
|
||||||
|
|
||||||
export function sha512(data: string, encode?: string): string | Buffer
|
export function sha512(data: string, encode?: string): string | Buffer
|
||||||
|
|
||||||
export function sha512Sign(path: string, encode?: string): string | Buffer
|
export function sha512Sign(path: string, encode?: string): string | Buffer
|
||||||
|
|
Loading…
Reference in New Issue