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 674881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:45:20+00:00 2026-05-14T00:45:20+00:00

I am writing a message transfer program between multiple clients and server. I want

  • 0

I am writing a message transfer program between multiple clients and server.

I want to generate a unique message ID for every message. It should be generated by the server and returned to the client.

For message transfer, I am using a hash data structure, for example:

{
api => POST,
username => sganesh,
pass => "pass",
message => "hai",
time => "current_time",
}

I want to generate a unique ID using this hash.

I have tried several approaches, MD5 and freeze but these give unreadable IDs. I want some meaningful or readable unique IDs.

I have thought we can use microseconds to differentiate between the IDs but here the problem is multiple clients.

In any situation the IDs should be unique.

Can anyone help me out of this problem?

Thanks in advance.

  • 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-05-14T00:45:21+00:00Added an answer on May 14, 2026 at 12:45 am

    I suspect you don’t want to do what you are asking, but you can do it.

    • Take the hash key/values and flatten them to an array @foo = (%foo).

    • MD5 the array to get an ID code – use md5_base64(@foo) if you want it to be 7bit (human readable).

    • Remember that hashes are not ordered, so you need sort @foo the array if you want it to be repeatable.

    In code, something like:

    use Digest::MD5 qw(md5_base64);
    
    my $foo = {
        api => POST,
        username => sganesh,
        pass => "pass",
        message => "hai",
        time => "current_time",
    };
    
    my $id = md5_base64(sort %$foo); # in my case eRR9QzGN1n+nIl1TDmclEA
    

    To be honest, I think you are better off generating a unique random ID (a token) and giving it to the client to return to you, but then from your question, I don’t know your motivation.

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

Sidebar

Related Questions

While writing a message on wire, I want to write down the number of
I'm writing a message processing application (email) that I want to have an outgoing
every time i am writing some data to my server i first send a
Writing some test scripts in IronPython, I want to verify whether a window is
From the client I am sending a string to the server what he should
I am in the process of writing a message queue system. My question is...
I receive the following message when i start writing something inside a textField: ***
I'm writing a simple private messenger using Django and am implementing message threading. Each
I'm writing a program for my intro to Java class. I'm getting an error
I'm writing an NSArray category to include the -objectAtRandom message that returns an object

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.