README
15ms-secure
The secure utility for 15ms server and client.
Usage
npm install --save @15ms/secure
const Secure = require('@15ms/secure');
const secure = new Secure({
secret: 'your-15ms-server-secret',
maxage: 30 * 1000
});
// create hash at client
const data = { 'your': 'data' };
const hash = secure.createHMAC(data);
// verify hash at server
const { data, hash } = request;
if (secure.verifyHMAC(data, hash)) {
// do something
}