How to convert byte array to BigInteger in java

前端 未结 2 679
天命终不由人
天命终不由人 2021-02-09 15:04

I\'m working on java... I want to know how to convert array of byte into BigInteger. Actually i used md5\'s digest method which returned me array of byte which i want to co

2条回答
  •  伪装坚强ぢ
    2021-02-09 15:38

    Actually i used md5's digest method which returned me array of byte which i want to convert into a BigInteger.

    You can use new BigInteger(byte[]).

    However, it should be noted that the MD5 hash is not really an integer in any useful sense. It is really just a binary bit pattern.

    I guess you are just doing this so that you can print or order the MD5 hashes. But there are less memory hungry ways of accomplishing both tasks.

提交回复
热议问题