Skip to content

Base-64 encoder and decoder for VLQ, handy eg. for sourcemaps

License

Notifications You must be signed in to change notification settings

Janiczek/elm-vlq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Janiczek/elm-vlq

VLQ (variable-length quantity) is a way to encode integers via text.

This base64-encoded variant is notably used in sourcemaps.

The minimum and maximum VLQ integer values representable by JavaScript bitwise operators are -2147483648 (-2^31) and 2147483647 (2^31 - 1) respectively.

VLQ.encode [ 1, 2, 3 ]
--> "CEG"

VLQ.encodeSingle 123456789
--> "qxmvrH"

VLQ.decode "AAAA"
--> Just [ 0, 0, 0, 0 ]

VLQ.decode "Not a VLQ string"
--> Nothing

This library is a port of Rich-Harris/vlq.

About

Base-64 encoder and decoder for VLQ, handy eg. for sourcemaps

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages