Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7972195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:48:08+00:00 2026-06-04T07:48:08+00:00

Is it possible to convert an UUID into a 128 bit integer using c++

  • 0

Is it possible to convert an UUID into a 128 bit integer using c++ under linux . Once I convert UUID to integer, I need to convert the 16 byte integer into a byte array so that I can send it to another server via TCP.

As far as I know(correct me if I am wrong), there’s no out of the box support for dealing with 16 byte integers in C++, can you please shed some light on how to do this? If it’s not possible to store and send it as an integer, I am thinking about sending the uuid as string.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T07:48:09+00:00Added an answer on June 4, 2026 at 7:48 am

    Why do you want to represent it as a 128 bit integer?

    How is the UUID represented? Presumably it’s a string or already some 16-byte type. If it’s a string then you can compute the 16-byte array representation yourself, and if it’s already some 16-byte long type then you can just view it directly as a 16-byte array.

    As always, whatever you do you’ll have to be sure all parties agree on byte ordering for the network representation.


    C++ implementations aren’t required to have a 128 bit integer type, but one of the built in types may be 128 bits. long long perhaps. Or your implementation might provide an extended integer type you can use.

    Clang and I think GCC both support a type __uint128_t, but unfortunately do not follow the C++ requirements for extended integers for this type. However 128 bit arithmetic should work and so you should be able to do the normal things to stick a UUID into this type and then view it as a 16-byte array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Convert Array into a primative method to express the same result, using
Is it possible to convert HTML + CSS into HTML for a system that
Possible Duplicate: Convert multidimensional array into single array I have this array: Array (
Possible Duplicate: convert string to 2D array using php I have the string like
Possible Duplicate: Convert array into csv Hi, How to convert array into .txt file?
Possible Duplicate: Convert a binary string representation to a byte array I have a
Possible Duplicate: Convert a string representation of a hex dump to a byte array
Possible Duplicate: Convert a string representation of a hex dump to a byte array
Is it possible to convert facebook data (ex. user_pic) into a DisplayObject so I
Is it possible to convert html tags to html entities using javascript/jquery using any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.