Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fernet

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fernet - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

2

lib/token.js

@@ -15,3 +15,3 @@ var fernet = require('../fernet');

if(opts.time) this.setTime(Date.parse(opts.time));
else this.setTime(Date.now());
else this.setTime();
}

@@ -18,0 +18,0 @@

{
"name": "fernet",
"version": "0.1.1",
"version": "0.2.0",
"description": "Javascript implementation of Fernet symmetric encryption https://github.com/kr/fernet-spec",

@@ -5,0 +5,0 @@ "main": "fernet.js",

@@ -68,17 +68,10 @@ //for browser compatibility

test('time defaults to Date.now()', function(){
var frozenNow = Date.now();
var oldNow = Date.now
Date.now = function(){
return frozenNow;
}
var token = new fernet.Token({
secret: secret
})
token.encode('foo');
assert.deepEqual(fernet.timeBytes(frozenNow), token.time);
Date.now = oldNow;
var cipherText = token.encode('foo');
var recovered = token.decode(cipherText);
assert.equal(recovered, 'foo');
})
})

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc