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

simple-signed-records-engine

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-signed-records-engine - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

17

index.js

@@ -8,14 +8,13 @@ /* Simple Signed Records Engine*/

const createBytesToSign = ({Version, Expiration, KeyType, Certified}) => {
const versionBytes = Buffer.from([0, 0, 0, 0]);
const expirationBytes = Buffer.from([0, 0, 0, 0, 0, 0, 0, 0]);
const keyTypeBytes = Buffer.from(KeyType);
const payloadBytes = Buffer.from(decodeBase64(Certified));
// Convert the version into a little-endian uint32 representation
for (let i = 0; i < 4; i++) {
versionBytes[i] = (Version >> (8 * i)) & 0xff;
}
let versionBytes = Buffer.from([0, 0, 0, 0]);
let expirationBytes = Buffer.from([0, 0, 0, 0, 0, 0, 0, 0]);
let keyTypeBytes = Buffer.from(KeyType);
let expireyBit = Expiration
// Convert the timestamp into a little-endian uint64 representation
for (let i = 0; i < 8; i++) {
expirationBytes[i] = (Expiration >> (8 * i)) & 0xff;
expirationBytes[i] = expireyBit & 0xff;
expireyBit = expireyBit >> 8;
}

@@ -25,3 +24,3 @@

const headers = Buffer.concat([versionBytes, expirationBytes, keyTypeBytes]);
return new Uint8Array(Buffer.concat([headers, payloadBytes]));
return Buffer.concat([headers, payloadBytes]);
};

@@ -28,0 +27,0 @@

{
"name": "simple-signed-records-engine",
"version": "0.1.2",
"version": "0.1.3",
"description": "cryptographic identity and content verification for decentralized apps",

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

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