Permalink
Browse files

use Array.isArray() instead of typeof

  • Loading branch information...
pvorb committed Nov 25, 2012
1 parent 0dcfc42 commit b6267b647a8fb16edf338f008d26e7670b09d105
Showing with 1 addition and 1 deletion.
  1. +1 −1 md5.js
View
2 md5.js
@@ -8,7 +8,7 @@
// Convert to byte array
if (message.constructor == String)
message = utf8.stringToBytes(message);
- else if (typeof message != 'object')
+ else if (!Array.isArray(message))
message = message.toString();
// else, assume byte array already

0 comments on commit b6267b6

Please sign in to comment.