Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

difference between this implementation and the Number.prototype.toString #21

Open
Strandedpirate opened this issue Dec 4, 2017 · 1 comment

Comments

@Strandedpirate
Copy link

I'm getting different results between implementations. I'm missing something. Other than the fact that this implementation is using crockford's limited character set why are these two base32 encodings wildly off?

var number = 14974;
number.toString(32); // -> eju
base32.encode(number.toString()); // -> 64u3jdtm
@Firer
Copy link

Firer commented Dec 18, 2017

Number.prototype.toString is changing a base 10 number into the chosen base/radix. https://en.wikipedia.org/wiki/Radix/

This library is turning an arbitrary string into a base 32 string.

In summary, the number 14974 is different from the string "14974".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants