title: How to convert a very large decimal string to hexadecimal?
body: <pre><code>let hex = "100000000000000000".as_bytes().to_hex();
  // hex == "313030303030303030303030303030303030"
  
  println!("{:x}", 100000000000000000000000u64);
  // literal out of range for u64
  </code></pre>
  
  <p>How can I got that value?</p>
  
  <p>In Python, I would just call <code>hex(100000000000000000000000)</code> and I get <code>'0x152d02c7e14af6800000'</code>.</p>
  
  <p><code>to_hex()</code> comes from the <a href="https://crates.io/crates/hex" rel="nofollow noreferrer">hex crate</a>.</p>