Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.72 KB

README.md

File metadata and controls

52 lines (38 loc) · 1.72 KB

BitString module

Maven Maven Central

<dependency>
    <groupId>io.github.neodix42</groupId>
    <artifactId>bitstring</artifactId>
    <version>0.8.2</version>
</dependency>

Jitpack

<dependency>
    <groupId>io.github.neodix42.ton4j</groupId>
    <artifactId>bitstring</artifactId>
    <version>0.8.2</version>
</dependency>

Usage example

BitString bitString=new BitString(1023);
        bitString.writeUint(BigInteger.valueOf(200),8);
        bitString.writeInt(BigInteger.valueOf(200),9);
        bitString.writeCoins(BigInteger.TEN);
        bitString.writeString("A");
        Address address=Address.of("0QAs9VlT6S776tq3unJcP5Ogsj-ELLunLXuOb1EKcOQi4-QO");
        bitString.writeAddress(address);
        log.info(bitString.toString());
        log.info(bitString.toBitString());

//result
        C86408520C002CF55953E92EFBEADAB7BA725C3F93A0B23F842CBBA72D7B8E6F510A70E422E3
        1100100001100100000010000101001000001100000000000010110011110101010110010101001111101001001011101111101111101010110110101011011110111010011100100101110000111111100100111010000010110010001111111000010000101100101110111010011100101101011110111000111001101111010100010000101001110000111001000010001011100011

More examples on how to construct BitString can be found in TestBitString class.