title: Swift: Byte array to decimal value
body: <p>In my project, I communicate with a bluetooth device, the bluetooth device must send me a timestamp second, I received in byte:</p>
  
  <pre><code>[2,6,239]
  </code></pre>
  
  <p>When I convert converted to a string:</p>
  
  <pre><code>let payloadString = payload.map {
              String(format: "%02x", $0)
          }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>["02", "06","ef"]
  </code></pre>
  
  <p>When I converted from the <a href="https://www.binaryhexconverter.com/hex-to-decimal-converter" rel="nofollow noreferrer">website</a> 0206ef = 132847 seconds</p>
  
  <p>How can I directly convert my aray <code>[2,6,239]</code> in second (= 132847 seconds)?
  And if it's complicated then translate my array <code>["02", "06,"ef"]</code> in second (= 132847 seconds)</p>