Skip to content

Instantly share code, notes, and snippets.

//validator.js
//This is not a recommended password policy, this is purely an example that allows me to use nodeunit
var minimumLength = 12;
var minimumCriteria = 4; //if you only want to impose 2 of the 4 possible criteria, simply change this to 2
var hasNumeric = /\d+/;
var hasUpper = /[A-Z]+/;
var hasLower = /[a-z]+/;
var hasSpecial = /[!\"£$%^&\*()_\+\-={}\[\];'#:@~,\.\/<>\\?\|]/;
//test_validator.js
var validator = require('./validator');
exports['validate'] = function (test) {
//these tests need to fail with an error being thrown
test.throws(function () { validator.validate(); }, 'Expected a string', 'value passed is not a string');
test.throws(function () { validator.validate(null); }, 'Expected a string', 'value passed is not a string');
test.throws(function () { validator.validate(true); }, 'Expected a string', 'value passed is not a string');
import java.security.MessageDigest;
public class KeyStretching {
public static void main(String[] args)
throws Exception {
String key = "";
String password = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
String salt = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
@JanPaulEttles
JanPaulEttles / jme7.java
Created June 19, 2012 12:10
jmeter_error
public final static String W_TIMEOUT = "ScriptSampler.doubleuTimeout"; //$NON-NLS-1$
...
public String getDoubleuTimeout() {
return getPropertyAsString(W_TIMEOUT);
}
public void setDoubleuTimeout(String doubleuTimeout) {
setProperty(W_TIMEOUT, doubleuTimeout);
doubleuTimeout.displayName=wtimeout
doubleuTimeout.shortDescription=The wtimeout value of the global WriteConcern. Default is 0.
@JanPaulEttles
JanPaulEttles / jme5.java
Created June 19, 2012 12:09
jmeter_error
createPropertyGroup("options", new String[] {
"doubleuTimeout",
"fsync",
"j",
"safe",
"w" });
...
p = property("doubleuTimeout");
@JanPaulEttles
JanPaulEttles / jme4.java
Created June 19, 2012 12:08
jmeter_error
public final static String W_TIMEOUT = "ScriptSampler.wTimeout"; //$NON-NLS-1$
...
public String getWTimeout() {
return getPropertyAsString(W_TIMEOUT);
}
public void setWTimeout(String wTimeout) {
setProperty(W_TIMEOUT, wTimeout);
wTimeout.displayName=wtimeout
wTimeout.shortDescription=The wtimeout value of the global WriteConcern. Default is 0.
@JanPaulEttles
JanPaulEttles / jme2.java
Created June 19, 2012 12:05
jmeter_error
createPropertyGroup("options", new String[] {
"wTimeout",
"fsync",
"j",
"safe",
"w" });
...
p = property("wTimeout");
@JanPaulEttles
JanPaulEttles / jme1.log
Created June 19, 2012 12:03
jmeter_error
ERROR - jmeter.testbeans.BeanInfoSupport: Cannot find property: wTimeout in class class jan.mongometer.ScriptSampler