diff --git a/core/crypto/src/pre-config.ts b/core/crypto/src/pre-config.ts new file mode 100644 index 000000000..bd3a5be08 --- /dev/null +++ b/core/crypto/src/pre-config.ts @@ -0,0 +1,27 @@ +import {HashGeneratorConfig, TokenGeneratorConfig} from './type.js'; + +/** + * Hash generator pre configuration for making random self-validate **secrets**. + */ +export const secretGeneratorPreConfig: HashGeneratorConfig = { + algorithm: 'sha256', + encoding: 'base64url', + crcLength: 4, +}; + +/** + * Hash generator pre configuration for making random self-validate **user-id**. + */ +export const userIdGeneratorPreConfig: HashGeneratorConfig = { + algorithm: 'sha1', + encoding: 'base64url', + crcLength: 4, +}; + +/** + * Token generator pre configuration for making secure self-validate **user-token**. + */ +export const userTokenGeneratorPreConfig: Pick = { + algorithm: 'sha224', + encoding: 'base64url', +};