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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:06:15+00:00 2026-06-12T18:06:15+00:00

I want to md5 an Array[Long] , so I would like to make that

  • 0

I want to md5 an Array[Long], so I would like to make that an Array[Byte] because the MD5 function takes an Array[Byte], how can I do that?

I use messagedigest for this.

  • 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-12T18:06:16+00:00Added an answer on June 12, 2026 at 6:06 pm

    Using ByteBuffer:

    val arr = listOfLongs.
      foldLeft(ByteBuffer.allocate(8 * listOfLongs.size)){ (buffer, lon) => 
        buffer putLong lon
      }.array
    

    Or more imperatively:

    val buffer = ByteBuffer.allocate(8 * listOfLongs.size)
    listOfLongs.foreach(buffer putLong _)
    val arr = buffer.array
    

    Note: if you need little-endian, just call:

    buffer.order(java.nio.ByteOrder.LITTLE_ENDIAN)
    

    at the beginning. Fore more inspiration: Convert long to byte array and add it to another array.

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

Sidebar

Related Questions

What I want to do is something like this: function registerUser($username, $password){ $this->db->insert('tblUsers', array('username'=>$username,
How can you make an own function in PHP such that I can bind
I am doing a md5 hash, and just want to make sure the result
I want to generate a random string of about 5 characters long. I can
I am trying to create a md5 string from the byte array of an
i have this multi dimentional array that i want to print into a table
I want to use md5() and crypt() together in php login authentication. I tried
I'm using md5 to encrypt the user's password in my database, and I want
This is the bit of Ruby I want to implement in Python: Base64.urlsafe_encode64([Digest::MD5.hexdigest(url).to_i(16)].pack(N)).sub(/==\n?$/, '')
Want to run javascript function from parent window in child window Example I have

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.