simple-signed-records-engine
Advanced tools
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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3669
82