diff --git a/lib/attribute.js b/lib/attribute.js index 3803ff6..0d1668d 100644 --- a/lib/attribute.js +++ b/lib/attribute.js @@ -185,7 +185,9 @@ Attribute.prototype.toString = function () { function formatGuid(format, data) { for (var i = 0; i < data.length; i++) { var re = new RegExp('\\{' + i + '\\}', 'g'); - format = format.replace(re, data[i].toString(16)); + // Leading 0 is needed if value of data[i] is less than 16 (of 10 as hex). + var dataStr = data[i].toString(16); + format = format.replace(re, data[i] >= 16 ? dataStr : '0' + dataStr); } return format; -} \ No newline at end of file +}