Repository

vlq

Encode and decode the Base64-encoded VLQ encoding. Note that there are several variants of VLQ. This only implements the variant used by source maps .

Installation

v install aheissenberger.vlq

Usage

Encoding

The methode expects a signed integer and will create a VLQ and write the base64 encoded data to the provide IO stream.

data = 123
encode(data,output) // '2H'

Decoding

Decode a single VLQ value from the input stream, returning the value.

/* input IO stream: '2H' */
res := decode(input) or { panic('panic') } 
println(res) // 123

API Documentation

auto generated documentation (created v doc -f md -m . -o . )

Roadmap

  • additional tests
  • performance benchmark

Contribution

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the "bsd-2-clause" License. See LICENSE.txt for more information.

About

0
63
1 year ago

Author

aheissenberger