@cloudpss/crypto 0.5.39 → 0.5.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,3 +3,4 @@ import type { EncryptedData, PlainData } from './common.js';
3
3
  export declare function encrypt(data: PlainData, passphrase: string): Promise<EncryptedData>;
4
4
  /** browser decrypt */
5
5
  export declare function decrypt(data: EncryptedData, passphrase: string): Promise<PlainData>;
6
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/encryption/browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAiB5D,sBAAsB;AACtB,wBAAsB,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAGzF;AAED,sBAAsB;AACtB,wBAAsB,OAAO,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAGzF"}
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
2
1
  const module = async () => {
3
2
  if (typeof crypto == 'object' &&
4
3
  typeof crypto.subtle == 'object' &&
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/encryption/browser.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,MAAM,MAAM,GAAG,KAAK,IAAI,EAAE;IACtB,IACI,OAAO,MAAM,IAAI,QAAQ;QACzB,OAAO,MAAM,CAAC,MAAM,IAAI,QAAQ;QAChC,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,IAAI,UAAU;QAC5C,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,IAAI,UAAU;QAC5C,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,UAAU;QAC1C,OAAO,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AC,IAAe,EAAE,UAAkB;IAC7D,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,EAAE,CAAC;IACnC,OAAO,MAAM,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAC3C,CAAC;AAED,sBAAsB;AACtB,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,IAAmB,EAAE,UAAkB;IACjE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,EAAE,CAAC;IACnC,OAAO,MAAM,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAC3C,CAAC"}
@@ -48,3 +48,4 @@ export declare const MAGIC_NUMBER: Uint8Array;
48
48
  export declare function padding(size: number, padding: number): number;
49
49
  /** 解析 CloudPSS 加密数据 */
50
50
  export declare function parseEncrypted(data: BinaryData): EncryptedData | undefined;
51
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/encryption/common.ts"],"names":[],"mappings":"AAEA,kBAAkB;AAClB,eAAO,MAAM,iBAAiB,SAAU,CAAC;AACzC,qBAAqB;AACrB,eAAO,MAAM,UAAU,QAAS,CAAC;AACjC,qBAAqB;AACrB,eAAO,MAAM,YAAY,QAAwB,CAAC;AAClD,uBAAuB;AACvB,eAAO,MAAM,YAAY,IAAI,CAAC;AAG9B,kBAAkB;AAClB,eAAO,MAAM,WAAW,QAAU,CAAC;AACnC,mBAAmB;AACnB,eAAO,MAAM,YAAY,QAAU,CAAC;AACpC,wBAAwB;AACxB,eAAO,MAAM,YAAY,QAAU,CAAC;AAEpC,gBAAgB;AAChB,MAAM,WAAW,SAAS;IACtB,WAAW;IACX,GAAG,EAAE,UAAU,CAAC;IAChB,WAAW;IACX,IAAI,EAAE,UAAU,CAAC;CACpB;AAED,gBAAgB;AAChB,MAAM,WAAW,aAAa;IAC1B,YAAY;IACZ,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW;IACX,GAAG,EAAE,UAAU,CAAC;IAChB,kBAAkB;IAClB,IAAI,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;;;;;;;;GAaG;AAEH,oBAAoB;AACpB,eAAO,MAAM,YAAY,YAAoE,CAAC;AAI9F,eAAe;AACf,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,uBAAuB;AACvB,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,aAAa,GAAG,SAAS,CAyB1E"}
@@ -23,3 +23,4 @@ encryptAad: (data: BinaryData, aad: BinaryData | undefined, passphrase: string)
23
23
  * @throws {TypeError} 如果密码无效
24
24
  */
25
25
  decrypt: (data: BinaryData, passphrase: string) => Promise<Uint8Array>;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/encryption/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,0BAA0B;AAC1B,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAErD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAQnE;AAED,eAAO;AACH;;;GAGG;AAEH,OAAO;AACP;;;GAGG;AAEH,UAAU;AACV;;;;GAIG;AAEH,OAAO,+DACW,CAAC"}
@@ -20,3 +20,4 @@ interface Module {
20
20
  /** 创建模块 */
21
21
  export declare function createModule(impl: typeof import('#encryption') | typeof import('./wasm.js')): Module;
22
22
  export {};
23
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/encryption/module.ts"],"names":[],"mappings":"AAsBA,SAAS;AACT,UAAU,MAAM;IACZ;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACnE;;;OAGG;IACH,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACnG;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACtE;AAED,WAAW;AACX,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,aAAa,CAAC,GAAG,cAAc,WAAW,CAAC,GAAG,MAAM,CAkDpG"}
@@ -3,3 +3,4 @@ import { type EncryptedData, type PlainData } from './common.js';
3
3
  export declare function encrypt({ data, aad }: PlainData, passphrase: string): Promise<EncryptedData>;
4
4
  /** nodejs decrypt */
5
5
  export declare function decrypt({ nonce, aad, data }: EncryptedData, passphrase: string): Promise<PlainData>;
6
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/encryption/node.ts"],"names":[],"mappings":"AACA,OAAO,EAKH,KAAK,aAAa,EAClB,KAAK,SAAS,EACjB,MAAM,aAAa,CAAC;AASrB,qBAAqB;AACrB,wBAAsB,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAWlG;AAED,qBAAqB;AACrB,wBAAsB,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAOzG"}
@@ -3,3 +3,4 @@ import { type EncryptedData, type PlainData } from './common.js';
3
3
  export declare function encrypt({ data, aad }: PlainData, passphrase: string): EncryptedData;
4
4
  /** crypto-js decrypt */
5
5
  export declare function decrypt({ data, aad, nonce }: EncryptedData, passphrase: string): PlainData;
6
+ //# sourceMappingURL=wasm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wasm.d.ts","sourceRoot":"","sources":["../../src/encryption/wasm.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,aAAa,EAElB,KAAK,SAAS,EACjB,MAAM,aAAa,CAAC;AAKrB,wBAAwB;AACxB,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,CAgBnF;AAED,wBAAwB;AACxB,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAc1F"}
@@ -3,3 +3,4 @@ import { type EncryptedData, type PlainData } from './common.js';
3
3
  export declare function encrypt({ data, aad }: PlainData, passphrase: string): Promise<EncryptedData>;
4
4
  /** webcrypto decrypt */
5
5
  export declare function decrypt({ data, nonce, aad }: EncryptedData, passphrase: string): Promise<PlainData>;
6
+ //# sourceMappingURL=web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/encryption/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,aAAa,EAClB,KAAK,SAAS,EAEjB,MAAM,aAAa,CAAC;AAmBrB,wBAAwB;AACxB,wBAAsB,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAkBlG;AAED,wBAAwB;AACxB,wBAAsB,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAgBzG"}
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { isEncrypted, encrypt, decrypt, encryptAad, extractAad } from './encryption/index.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC"}
package/dist/utils.d.ts CHANGED
@@ -2,3 +2,4 @@
2
2
  export declare function toUint8Array(data: BinaryData): Uint8Array;
3
3
  /** 长度为 0 的 Uint8Array */
4
4
  export declare const EMPTY_BUFFER: Uint8Array;
5
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAQzD;AAED,yBAAyB;AACzB,eAAO,MAAM,YAAY,YAAoB,CAAC"}
package/jest.config.js CHANGED
@@ -1,3 +1,3 @@
1
- import { config } from '../../jest.config.js';
1
+ import { config } from '../jest.config.js';
2
2
 
3
3
  export default { ...config };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudpss/crypto",
3
- "version": "0.5.39",
3
+ "version": "0.5.41",
4
4
  "author": "CloudPSS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,8 +21,7 @@
21
21
  "esbuild-plugin-wasm": "^1.1.0"
22
22
  },
23
23
  "scripts": {
24
- "start": "pnpm clean && pnpm build:wasm && tsc --watch",
25
- "build": "pnpm clean && pnpm build:wasm && tsc",
24
+ "build": "pnpm clean && pnpm build:wasm && tsc --build --force",
26
25
  "build:wasm": "node ./wasm-build.js",
27
26
  "test": "NODE_OPTIONS=\"${NODE_OPTIONS:-} --experimental-vm-modules\" jest",
28
27
  "benchmark": "node ./benchmark",
@@ -1,6 +1,5 @@
1
1
  import type { EncryptedData, PlainData } from './common.js';
2
2
 
3
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
4
3
  const module = async () => {
5
4
  if (
6
5
  typeof crypto == 'object' &&
@@ -1,9 +1,3 @@
1
1
  {
2
- "extends": "../tsconfig",
3
- "include": ["./"],
4
- "compilerOptions": {
5
- "checkJs": true,
6
- "noEmit": true,
7
- "rootDir": "."
8
- }
2
+ "extends": "../../tsconfig.test"
9
3
  }
package/tsconfig.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "extends": "../../tsconfig",
2
+ "extends": "../tsconfig.build",
3
3
  "compilerOptions": {
4
4
  "paths": {
5
5
  "#encryption": ["./src/encryption/node.ts", "./src/encryption/browser.ts"],