UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

2 lines 476 B
import e from"../../constants/constants.mjs";import t from"../helpers/generate-secret.mjs";import{scrypt as n}from"@noble/hashes/scrypt.js";import{randomBytes as r}from"@noble/hashes/utils.js";const i=async i=>{let a=Buffer.from(r(32)).toString(`hex`),{secret:o,encryptSecret:s}=t(i),c=Buffer.from(n(a,o,e.scrypt)).toString(`base64`);return{key:Buffer.from(r(3)).toString(`hex`),apiKey:a,apiKeyHash:c,secret:s}};export{i as default}; //# sourceMappingURL=generate-keys.mjs.map