本文介绍了如何在java中将字节数组转换为BigInteger的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究java ...我想知道如何将字节数组转换为BigInteger。
实际上我使用了md5的摘要方法,它返回了我想要转换成Biginteger的字节数组。

解决方案

您可以使用 new BigInteger(byte [])





我想你只是这样做,这样你就可以打印或订购MD5哈希。但是,完成这两项任务的内存消耗较少。


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 convert into 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.

这篇关于如何在java中将字节数组转换为BigInteger的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 05:44