Socket
Socket
Sign inDemoInstall

@cyyynthia/tokenize

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cyyynthia/tokenize - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

13

index.js
/*
* Copyright (c) 2020 Cynthia K. Rey, All rights reserved.
* Copyright (c) 2020-2021 Cynthia K. Rey, All rights reserved.
*

@@ -30,3 +30,2 @@ * Redistribution and use in source and binary forms, with or without

/**

@@ -70,4 +69,4 @@ * Signs a string with the HMAC-SHA256 algorithm

class Tokenize {
get VERSION () { return 1 }
get TOKENIZE_EPOCH () { return 1546300800000 }
static get VERSION () { return 1 }
static get TOKENIZE_EPOCH () { return 1546300800000 }

@@ -115,4 +114,6 @@ /**

const genTime = parseInt(Buffer.from(splitted[1], 'base64').toString('utf8'), 10)
if (isNaN(genTime)) return false
const accountId = Buffer.from(splitted[0], 'base64').toString('utf8')
const genTime = Buffer.from(splitted[1], 'base64').toString('utf8')
const account = accountFetcher(accountId, prefix)

@@ -136,3 +137,3 @@ if (!account) return null

if (typeof lastTokenReset !== 'number' || lastTokenReset > genTime) return null
if (typeof lastTokenReset !== 'number' || lastTokenReset > ((genTime * 1000) + Tokenize.TOKENIZE_EPOCH)) return null
return account

@@ -139,0 +140,0 @@ }

{
"name": "@cyyynthia/tokenize",
"version": "1.1.2",
"version": "1.1.3",
"description": "A universal token format for authentication. Designed to be secure, flexible, and usable anywhere.",

@@ -5,0 +5,0 @@ "main": "./index.js",

Sorry, the diff of this file is not supported yet

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