version-encoder
Encode a x.y.z type version number up to v255.255.255.
Last updated 3 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install version-encoder 
SYNC missed versions from official npm registry.

version-encoder build status

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

Current Tags

  • 0.1.0                                ...           latest (3 years ago)

1 Versions

  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |