base62 / base62.js

:abcd: A javascript Base62 encode/decoder for node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

modular ES6 variant

FND opened this issue · comments

commented

As discussed elsewhere, I found myself accidentally re-implementing Base62.js in modular ES6: https://github.com/FND/base62
Now that I've recognized my folly, rather than imposing yet another npm package on the world, it seems worth first considering to merge our efforts instead.

My goal there was to create an efficient library that works in any JavaScript engine (i.e. browsers as well as Node, Nashorn etc.). The only expectation is either ES2015 support or DIY ES5 transpiling - which doesn't have to be painful these days.

ES6 helps not just with readability and hipster cred, but modular exports also avoid including unused bits (think tree shaking).

Preliminary benchmarking (I'm not much of an authority there) suggests that my version is at least on par with the current implementation.

I realize that in its current form, my version's API and aforementioned expectations aren't compatible with Base62.js v1.x, but that's not necessarily a bad thing and still up for debate.

Let me know what you think. (I've tried writing concise and readable code as well as useful commit messages.)

If we can keep the backwards compatibility (for all the people who depend on ‘*’, then I’m all for this 👍

commented

Thanks, Andrew. Let's continue this in #70 then.