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

Ask A Question

Stats

  • Questions 493k
  • Answers 493k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This part: $('tr', $this).hover(function(){ var cur_color = null; cur_color =… May 16, 2026 at 10:39 am
  • Editorial Team
    Editorial Team added an answer Yes it is. See this Swing Tutorial Track: http://download.oracle.com/javase/tutorial/uiswing/components/table.html#combobox May 16, 2026 at 10:39 am
  • Editorial Team
    Editorial Team added an answer I fixed the above issue by removing e.preventDefault() and by… May 16, 2026 at 10:39 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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
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 am writing a program to leak memory( main memory ) to test how
I have an MHTML file which has embedded images. The MHTML is generated on
I'm tasked with writing an application that acts as a central storage point for
I'm writing a chat client (msn messenger style) and I've got some problems in
I'm writing a windows application in C++ and encountered the following problem when working

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.