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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Using
ByteBuffer:Or more imperatively:
Note: if you need little-endian, just call:
at the beginning. Fore more inspiration: Convert long to byte array and add it to another array.