Skip to content

Commit

Permalink
refactor(constants.js): Add version constants
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed May 22, 2018
1 parent c1ef6b9 commit 2744596
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
'use strict'

const { version } = require('./package')

const versions = version.split('.').map((v) => parseInt(v))
const [
kVersionMajor,
kVersionMinor,
kVersionPatch,
] = versions

const kVersion = versions[0] << 16 | versions[1] << 8 | versions[2]

// blake2b()
const kDefaultBlake2bSize = 32

Expand All @@ -22,4 +33,9 @@ module.exports = {
kDefaultDigest,

kMinUInt64Size,

kVersionMajor,
kVersionMinor,
kVersionPatch,
kVersion,
}

0 comments on commit 2744596

Please sign in to comment.