Function ArrayBuffertohex

  • convert an ArrayBuffer to a hexadecimal string

    Parameters

    • buffer: ArrayBuffer

      ArrayBuffer

    Returns string

    hexadecimal string

    Description

    This function converts from an ArrayBuffer to a hexadecimal string.

    Example

    var buffer = new ArrayBuffer(3);
    var view = new DataView(buffer);
    view.setUint8(0, 0xfa);
    view.setUint8(1, 0xfb);
    view.setUint8(2, 0x01);
    ArrayBuffertohex(buffer) -> "fafb01"