Skip to content

Commit

Permalink
feat(crypto): add some pre config
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD authored and njfamirm committed May 18, 2023
1 parent ba8c4bc commit 4b960c5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions core/crypto/src/pre-config.ts
Original file line number Diff line number Diff line change
@@ -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<TokenGeneratorConfig, 'algorithm' | 'encoding'> = {
algorithm: 'sha224',
encoding: 'base64url',
};

0 comments on commit 4b960c5

Please sign in to comment.