mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
give the improper result for characters a-f.
See below for related snippet, spaced to make reading easy
X marks the spot!:
> s
["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]
> _.map(s, function(input) { return ((input & 0x3)| 0x8)})
[ 8, 9, 10, 11, 8, 9, 10, 11, 8, 9, 8, 8, 8, 8, 8, 8]
X, X, X, X, X
_.map(s, function(input) { return ((parseInt(input,16) & 0x3)| 0x8)})
> [8, 9, 10, 11, 8, 9, 10, 11, 8, 9, 10, 11, 8, 9, 10, 11]