Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setKdfParameter(field, value) {
const ValueType = kdbxweb.VarDictionary.ValueType;
switch (field) {
case 'memory':
this.db.header.kdfParameters.set('M', ValueType.UInt64, kdbxweb.Int64.from(value));
break;
case 'iterations':
this.db.header.kdfParameters.set('I', ValueType.UInt64, kdbxweb.Int64.from(value));
break;
case 'parallelism':
this.db.header.kdfParameters.set('P', ValueType.UInt32, value);
break;
case 'rounds':
this.db.header.kdfParameters.set('R', ValueType.UInt32, value);
break;
default:
return;
}