Implement strength for whole library

This commit is contained in:
2024-09-12 01:31:45 +02:00
parent 524e9026b8
commit 76cf4632e4
14 changed files with 97 additions and 66 deletions
+13
View File
@@ -5,6 +5,19 @@ import PrivateWrap from './src/private-wrap'
import PwdBox from './src/pwd-box'
import PwdWrap from './src/pwd-wrap'
export enum Strength {
weak,
moderate,
strong
}
export const set_strength = (new_strength: Strength) => {
if (!(new_strength in Strength)) throw 'Invalid strength !'
strength = new_strength
}
let strength = Strength.moderate
export let STRENGTH: () => Strength = () => strength
export * as kdf from './src/kdf'
export * as misc from './src/misc'
export * as signature from './src/signature'