1.0.3 • Published 7 months ago

mas-encrypt v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

一个加密工具

  import { encode, decode } from "mas-encrypt";
  let str = encode([1,2,3], "8087", 1);
  console.log(str);
  str = decode(str, "8087", 1)
  console.log(str); //[ 1, 2, 3 ]
  str = decode("sdsdsd", "8087", 1) 
  console.log(str); //false
declare module 'mas-encrypt' {
  /**
   * 加密字符串
   * @param text 要加密的文本
   * @param key 秘钥
   * @param longMode 是否开启长模式,默认0不开启,1开启
   */
    export function encode(
    text: any,
    key: string,
    longMode: number
  ): string | object;
  /**
   * 加密字符串,解密失败返回false
   * @param text 要解密的文本
   * @param key 秘钥
   * @param longMode 是否开启长模式,默认0不开启,1开启
   */
  export function decode(
    text: string,
    key: string,
    longMode: number
  ): string | object | false;
  
  }
1.0.3

7 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

2 years ago