@stacksjs/security 0.58.73 → 0.59.1

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.
@@ -0,0 +1,3 @@
1
+ declare function encrypt(message: string): string;
2
+ declare function decrypt(encrypted: string): string;
3
+ export { encrypt, decrypt };
package/dist/hash.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ declare function make(password: string, algorithm?: string): Promise<string>;
2
+ type Algorithm = 'bcrypt' | 'base64';
3
+ declare function verify(password: string, hash: string, algorithm?: Algorithm): Promise<boolean>;
4
+ declare function bcryptEncode(password: string): Promise<string>;
5
+ declare function bcryptVerify(password: string, hash: string): Promise<boolean>;
6
+ declare function base64Encode(password: string): string;
7
+ declare function base64Verify(password: string, hash: string): boolean;
8
+ declare function md5Encode(password: string): CryptoJS.lib.WordArray;
9
+ export { make as makeHash, verify as verifyHash, base64Encode, base64Verify, bcryptEncode, bcryptVerify, md5Encode };
@@ -0,0 +1,3 @@
1
+ export * from './key';
2
+ export * from './crypt';
3
+ export * from './hash';
package/dist/index.js CHANGED
@@ -3079,10 +3079,8 @@ var decrypt = function(encrypted) {
3079
3079
  var import_bcryptjs = __toESM(require_bcrypt(), 1);
3080
3080
 
3081
3081
  // ../../../../node_modules/js-base64/base64.mjs
3082
- var version = "3.7.6";
3082
+ var version = "3.7.7";
3083
3083
  var VERSION = version;
3084
- var _hasatob = typeof atob === "function";
3085
- var _hasbtoa = typeof btoa === "function";
3086
3084
  var _hasBuffer = typeof Buffer === "function";
3087
3085
  var _TD = typeof TextDecoder === "function" ? new TextDecoder : undefined;
3088
3086
  var _TE = typeof TextEncoder === "function" ? new TextEncoder : undefined;
@@ -3109,7 +3107,7 @@ var btoaPolyfill = (bin) => {
3109
3107
  }
3110
3108
  return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
3111
3109
  };
3112
- var _btoa = _hasbtoa ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, "binary").toString("base64") : btoaPolyfill;
3110
+ var _btoa = typeof btoa === "function" ? (bin) => btoa(bin) : _hasBuffer ? (bin) => Buffer.from(bin, "binary").toString("base64") : btoaPolyfill;
3113
3111
  var _fromUint8Array = _hasBuffer ? (u8a) => Buffer.from(u8a).toString("base64") : (u8a) => {
3114
3112
  const maxargs = 4096;
3115
3113
  let strs = [];
@@ -3158,7 +3156,7 @@ var atobPolyfill = (asc) => {
3158
3156
  }
3159
3157
  return bin;
3160
3158
  };
3161
- var _atob = _hasatob ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill;
3159
+ var _atob = typeof atob === "function" ? (asc) => atob(_tidyB64(asc)) : _hasBuffer ? (asc) => Buffer.from(asc, "base64").toString("binary") : atobPolyfill;
3162
3160
  var _toUint8Array = _hasBuffer ? (a) => _U8Afrom(Buffer.from(a, "base64")) : (a) => _U8Afrom(_atob(a).split("").map((c) => c.charCodeAt(0)));
3163
3161
  var toUint8Array = (a) => _toUint8Array(_unURI(a));
3164
3162
  var _decode = _hasBuffer ? (a) => Buffer.from(a, "base64").toString("utf8") : _TD ? (a) => _TD.decode(_toUint8Array(a)) : (a) => btou(_atob(a));
package/dist/key.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function generateAppKey(): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/security",
3
3
  "type": "module",
4
- "version": "0.58.73",
4
+ "version": "0.59.1",
5
5
  "description": "The Stacks framework security.",
6
6
  "author": "Chris Breuer",
7
7
  "license": "MIT",
@@ -58,7 +58,7 @@
58
58
  "@stacksjs/validation": "latest",
59
59
  "bcryptjs": "^2.4.3",
60
60
  "crypto-js": "^4.2.0",
61
- "js-base64": "^3.7.6"
61
+ "js-base64": "^3.7.7"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@stacksjs/development": "latest"