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.
v install aheissenberger.vlq
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'
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
auto generated documentation
(created v doc -f md -m . -o .
)
- additional tests
- performance benchmark
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.
- Fork the Project
- Create your Feature Branch (git checkout -b feature/AmazingFeature)
- Commit your Changes (git commit -m 'Add some AmazingFeature')
- Push to the Branch (git push origin feature/AmazingFeature)
- Open a Pull Request
Distributed under the "bsd-2-clause" License. See LICENSE.txt for more information.