S
S
supreme192018-12-09 10:38:25
Java
supreme19, 2018-12-09 10:38:25

How to convert large number to byte?

I do encryption using bit shifts in a byte. But if a byte is assigned a value greater than 127, it starts to lose data. How can I correctly convert a large number into bytes without losing data or so that it can be restored later?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2018-12-09
@GavriKos

Store a number in multiple bytes.

O
Oleg Mikhailov, 2018-12-09
@Olegatorapp

Or just use byte[]
Even with an example, you can easily convert back
https://www.tutorialspoint.com/java/math/bigintege...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question