0.1.0 • Published 6 years ago
version-encoder v0.1.0
version-encoder
Encode a x.y.z type version number up to v255.255.255.
const { encode, decode } = require('version-encoder')
const encoded = encode('5.11.2')
const decoded = decode(encoded)
console.log({ encoded, decoded })
// => { encoded: '1Gi2', decoded: '5.11.2' }
Installation
npm install version-encoder
API
words
The amount of 6bit words into which a version is encoded (4 words == 24 bit).
Type: Number
encode
Encodes a version of the format x.y.z
representing major.minor.patch
Parameters
s
String the version string, i.e.1.3.2
Returns String the 6bit encoded version into 4 chars
decode
Decodes a version encoded via @see encode
Parameters
chars
String 4 chars representing the encoded version
Returns String the version string, i.e. 1.2.3
License
MIT
0.1.0
6 years ago