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

Caching can cause problems #2

Closed
btoc007 opened this issue Jan 11, 2013 · 0 comments
Closed

Caching can cause problems #2

btoc007 opened this issue Jan 11, 2013 · 0 comments
Assignees

Comments

@btoc007
Copy link

btoc007 commented Jan 11, 2013

Since in Javascript, map keys are always strings there are cases where unexpected cache hits can occur.

For example,

var _1 = base58.encode(202);
var _2 = base58.decode('202');
var _3 = base58.encode(202);

console.log(_1 === _3);

The result here is false where it should be true. Either caching can be removed or there needs to be two separate caches, one for encode and one for decode.

@ghost ghost assigned ianoxley Jan 11, 2013
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