Can you switch to https://github.com/Coreh/uid2 ? `uid2` on npm. It's what connect actually uses for csrf token generation: https://github.com/senchalabs/connect/blob/master/lib/middleware/csrf.js