base62 / base62.js Goto Github PK
View Code? Open in Web Editor NEW:abcd: A javascript Base62 encode/decoder for node.js
License: MIT License
:abcd: A javascript Base62 encode/decoder for node.js
License: MIT License
I'm trying to convert base 62 to base 16. When I do the following..
Base62.decode('4u8LPK581OHn7kRqRqP9ks').toString(16)
I get 93669fd54as300000000000000000000. I'm expecting A12D08BC6D93BC4E8EA847434C960416. You can see a php based converter here http://convertxy.com/index.php/numberbases/ return the correct value.
Is the difference due to JS using scientific notation for these large numbers? In other words, Base62.decode('4u8LPK581OHn7kRqRqP9ks') returns 1.9592937146177773e+38. Does that munge the conversion to base 16 via toString(16)?
Thanks.
Libraries.io has found that there is a newer version of balanced-match that this project depends on.
Libraries.io has found that there is a newer version of growl that this project depends on.
More info: https://libraries.io/npm/growl/1.10.0
Libraries.io has found that there is a newer version of diff that this project depends on.
More info: https://libraries.io/npm/diff/3.3.0
Libraries.io has found that there is a newer version of supports-color that this project depends on.
var Base62=require('base62');
var maxv= Base62.decode("ZZZZZZZZZZ");
var mmaxv = Base62.encode(maxv);
console.log("maxv=" +maxv+" mmaxv="+mmaxv);
> maxv=839299365868340200 mmaxv=10000000000
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/3.3.0
base62.js is one of dependency in my project. :)
I have one problem with install-stats.js in base62/scripts.
Internal network case, because install-stats.js tries to connect google analytics, so npm install takes too long time, and fails to connect in the end.
This makes build time to be increased.
Could you add timeout for this process or give any option to disable it?
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/3.5.1
Libraries.io has found that there is a newer version of supports-color that this project depends on.
I would like to use base62 in my project, but you haven't included a license, so I can't. Could you pick one? (MIT or similar would be great.)
Thanks in advance!
What would be the proper way to convert base16 strings into base64 strings, and vice versa ?
For example: (b16) 0xF216E209761BB32986723 -> (b64) ????
I just used NPM to download the latest version, 0.1.1 and it doesn't give me the latest version from github.
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/4.0.1
Your recent change to the package json, specifically the postinstall where you're trying to scrape stats is causing install failures
"postinstall": "TID=UA-265870-43 node scripts/install-stats.js"
Libraries.io has found that there is a newer version of growl that this project depends on.
More info: https://libraries.io/npm/growl/1.10.3
Libraries.io has found that there is a newer version of commander that this project depends on.
More info: https://libraries.io/npm/commander/2.11.0
Hi, I see that a version 1.2.8
is listed on npm but I cannot find the tag here. Could you push it by chance? Thanks.
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/2.5.0
Libraries.io has found that there is a newer version of growl that this project depends on.
More info: https://libraries.io/npm/growl/1.10.4
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/3.1.0
Libraries.io has found that there is a newer version of growl that this project depends on.
More info: https://libraries.io/npm/growl/1.10.1
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/3.2.0
Libraries.io has found that there is a newer version of brace-expansion that this project depends on.
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 export
s 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.)
Libraries.io has found that there is a newer version of debug that this project depends on.
More info: https://libraries.io/npm/debug/1.0.5
Libraries.io has found that there is a newer version of supports-color that this project depends on.
If the input string starts with 0 then that 0 is lost during encoding.
for e.g. if the input is 0zebra then b62.encode(b62.decode("0zebra")) outputs zebra
b62.encode(b62.decode("0000zebra")) //zebra
Libraries.io has found that there is a newer version of brace-expansion that this project depends on.
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/4.0.0
Libraries.io has found that there is a newer version of supports-color that this project depends on.
Libraries.io has found that there is a newer version of supports-color that this project depends on.
FYI, this tripped me up for a bit. You use G7 converting to 999 in your example. But with your default character set, decode('G7') == 2611.
You need to run:
b.setCharacterSet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz');
to get decode('G7') == 999
Libraries.io has found that there is a newer version of debug that this project depends on.
More info: https://libraries.io/npm/debug/3.1.0
Libraries.io has found that there is a newer version of commander that this project depends on.
More info: https://libraries.io/npm/commander/2.10.0
Libraries.io has found that there is a newer version of debug that this project depends on.
More info: https://libraries.io/npm/debug/2.6.9
Libraries.io has found that there is a newer version of diff that this project depends on.
More info: https://libraries.io/npm/diff/3.4.0
Libraries.io has found that there is a newer version of growl that this project depends on.
More info: https://libraries.io/npm/growl/1.10.2
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/2.5.0
Libraries.io has found that there is a newer version of commander that this project depends on.
More info: https://libraries.io/npm/commander/2.14.0
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/3.4.1
Libraries.io has found that there is a newer version of commander that this project depends on.
More info: https://libraries.io/npm/commander/2.14.1
Libraries.io has found that there is a newer version of supports-color that this project depends on.
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/3.1.1
Libraries.io has found that there is a newer version of mocha that this project depends on.
More info: https://libraries.io/npm/mocha/3.0.0
Libraries.io has found that there is a newer version of diff that this project depends on.
More info: https://libraries.io/npm/diff/3.3.1
Libraries.io has found that there is a newer version of supports-color that this project depends on.
Libraries.io has found that there is a newer version of brace-expansion that this project depends on.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.