ndef-lib/ndef-util.js
function toHex(i) {
    var hex;

    if (i < 0) {
        i += 256;
    }
    hex = i.toString(16);

    // zero padding
    if (hex.length == 1) {
        hex = "0" + hex;
    }
    return hex;
}
function toHex(i) {
    var hex;

    if (i < 0) {
        i += 256;
    }
    hex = i.toString(16);

    // zero padding
    if (hex.length == 1) {
        hex = "0" + hex;
    }
    return hex;
}
function toHex ( i ) { var hex ; if ( i < 0 ) { i += 256 ; } hex = i . toString ( 16 ) ; // zero padding if ( hex . length == 1 ) { hex = "0" + hex ; } return hex ; }
i must be <= 256
i must be < = 256