inibase 1.2.12 → 1.2.13
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.
- package/dist/utils.server.js +7 -2
- package/package.json +1 -1
package/dist/utils.server.js
CHANGED
|
@@ -62,8 +62,13 @@ export const encodeID = (id) => {
|
|
|
62
62
|
export function decodeID(input, raw) {
|
|
63
63
|
const { key, iv } = getKeyAndIv();
|
|
64
64
|
const decipher = createDecipheriv("aes-256-cbc", key, iv);
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
try {
|
|
66
|
+
const rawData = decipher.update(input, "hex", "utf8") + decipher.final("utf8");
|
|
67
|
+
return raw ? rawData : Number(rawData);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
67
72
|
}
|
|
68
73
|
// Function to recursively flatten an array of objects and their nested children
|
|
69
74
|
export const extractIdsFromSchema = (schema) => {
|