Random String Generation
Generates a cryptographically strong random string. The argument specifies the length of the string.
const Cryptiles = require('cryptiles');
const randomString = Cryptiles.randomString(32);
Fixed Time String Comparison
Compares two strings in constant time to prevent timing attacks. It returns true if the strings are equal, false otherwise.
const Cryptiles = require('cryptiles');
const a = 'some string';
const b = 'some string';
const comparisonResult = Cryptiles.fixedTimeComparison(a, b);