Permalink
Browse files

using released 0.2.0 version

  • Loading branch information...
1 parent 540ddee commit ee160b9427870c9234f6ad72a0ee24c646f85c4c @m00sey m00sey committed Sep 9, 2011
Showing with 19 additions and 1 deletion.
  1. +19 −1 assets/www/phonegap-nfc-0.2.0.js
  2. BIN lib/phonegap-nfc-0.2.0.jar
@@ -168,5 +168,23 @@ var nfc = {
}
// return an array of bytes
return re;
+ },
+
+ bytesToHexString: function (bytes) {
+ var bytesAsHexString = "";
+ for (var i = 0; i < bytes.length; i++) {
+ if(bytes[i] >= 0) {
+ dec = bytes[i];
+ } else {
+ dec = 256 + bytes[i];
+ }
+ hexstring = dec.toString(16);
+ // zero padding
+ if(hexstring.length == 1) {
+ hexstring = "0" + hexstring;
+ }
+ bytesAsHexString += hexstring;
+ }
+ return bytesAsHexString;
}
-};
+};
View
Binary file not shown.

0 comments on commit ee160b9

Please sign in to comment.