public class Bin extends Object
| コンストラクタと説明 |
|---|
Bin() |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
static byte[] |
and(byte[] a,
byte[] b)
aの長さ合わせAND.
|
static byte[] |
and(byte[] a,
int aoffset,
byte[] b,
int boffset,
byte[] ret)
左詰めAND.
|
static int[] |
btoi(byte[] src)
byte[]をint[]に変換する.
|
static int[] |
btoi(byte[] src,
int offset,
int length)
byte列の一部をint列に変換する
|
static void |
btoi(byte[] src,
int offset,
int[] dst,
int length)
byte[]をint[]に変換する.
|
static long[] |
btol(byte[] src)
byte[]をlong[]に変換する.
|
static long[] |
btol(byte[] src,
int offset,
int length)
byte列の一部をlong列に変換する
|
static void |
btol(byte[] src,
int offset,
long[] dst,
int length)
byte列の一部をlong列に変換する
|
static void |
inc(byte[] src)
byte列を大きな数値として+1する
|
static void |
inc(long[] src)
long列を大きな数値として+1する
|
static byte[] |
itob(int[] src)
int列をbyte列に変換する.
|
static byte[] |
itob(int[] src,
byte[] ss,
int doffset)
int[]をbyte[]に戻す.
|
static byte[] |
itob(int[] src,
int offset,
int len)
int列の一部をbyte列に変換する
|
static long[] |
itol(int[] src)
int列をlong列に変換する
|
static void |
itol(int[] src,
int offset,
long[] dst,
int length)
byte列の一部をlong列に変換する
|
static byte[] |
left(byte[] a,
int shift)
MSB が 配列 0 側にある想定のシフト演算
|
static byte[] |
ltob(long[] src)
long列をbyte列に変換する
|
static byte[] |
ltob(long[] src,
byte[] ss,
int doffset)
long[] to byte[].
|
static byte[] |
ltob(long[] src,
int offset,
int srclen)
long列の一部をbyte列に変換する
|
static int[] |
ltoi(long[] src)
long列をint列に変換する
|
static int[] |
ltoi(long[] src,
int offset,
int length)
long列の一部をint列に変換する
|
static void |
ltoi(long[] src,
int offset,
int[] dst,
int length)
long列の一部をint列に変換する
|
static byte[] |
not(byte[] a) |
static byte[] |
not(byte[] a,
int aoffset,
byte[] ret) |
static byte[] |
or(byte[] a,
byte[] b) |
static byte[] |
or(byte[] a,
int aoffset,
byte[] b,
int boffset,
byte[] ret)
OR
|
static byte[] |
right(byte[] a,
int shift) |
static byte[] |
rol(byte[] a) |
static byte[] |
ror(byte[] a)
右1bit rotate
|
static int[] |
ror(int[] a)
右1bit rotate
|
static long[] |
ror(long[] a) |
static byte[] |
shl(byte[] a)
Big endian 左シフト
|
static long[] |
shl(long[] a)
Big endian 左シフト
|
static byte[] |
shr(byte[] a)
右1bitシフト
|
static int[] |
shr(int[] a)
右1bitシフト
|
static long[] |
shr(long[] a)
右1bitシフト
|
static byte[] |
toByte(int i)
intを4バイトに変換する
|
static byte[] |
toByte(int i,
byte[] out,
int offset)
int を out の offset位置から big endian 4バイトで書き込む.
|
static byte[] |
toByte(long l)
longをbig endian 8バイトに変換する
|
static byte[] |
toByte(long l,
byte[] out,
int offset)
long を out の offset位置から big endian 8バイトで書き込む.
|
static byte[] |
toByte(short i)
short を big endian 2バイトに変換する
|
static byte[] |
toByte(short i,
byte[] out,
int offset)
short を out の offset位置から big endian 2バイトで書き込む.
|
static byte[] |
toByteArray(BigInteger num,
int length)
new BigInteger(byte[]) の逆にしたい.
|
static byte[] |
toByteArray(char[] txt) |
static byte[] |
toByteArray(char[] txt,
int radixBase)
n進数を変換する試み.
2進数からHEX64まで対応したりしなかったり
BigIntegerでまわすのでスピードは期待しない方向で
36進数までは 0-9,a-z,A-Z
62進数まではa-zとA-Zを区別する
64進数までは記号をいくつか
|
static byte[] |
toByteArray(char[] hex,
int offset,
int length)
16進数をバイト列に変換する。
|
static byte[] |
toByteArray(CharSequence src)
16進数をバイト列に変換する。
|
static byte[] |
toByteArray(String src)
16進数をバイト列に変換する。
|
static String |
toHex(byte[] src)
バイト列を16進数(小文字)に変換する.
|
static String |
toUpperHex(byte[] src)
バイト列を16進数(大文字)に変換する.
|
static byte[] |
xor(byte[] a,
byte[] b)
XORを計算するよ
|
static byte[] |
xor(byte[] a,
int aoffset,
byte[] b,
int boffset,
byte[] ret,
int roffset)
非推奨です。
まだ未確定
|
static long[] |
xor(long[] a,
int aoffset,
long[] b,
int boffset,
long[] ret)
a と b の offset からの xor.
|
static long[] |
xor(long[] a,
long[] b)
aとbのxorを返す.
|
static byte[] |
xorl(byte[] a,
byte[] b)
a と b の xor 計算を a に戻す
|
static long[] |
xorl(long[] a,
long[] b)
long列のXOR
|
public static String toHex(byte[] src)
src - バイト列public static String toUpperHex(byte[] src)
src - バイト列public static byte[] toByteArray(CharSequence src)
src - 2の倍数の長さ限定 16進数文字列public static byte[] toByteArray(String src)
src - 2の倍数の長さ限定 16進数文字列public static byte[] toByteArray(char[] txt)
public static byte[] toByteArray(char[] hex,
int offset,
int length)
hex - 2の倍数の長さ限定 16進数文字列offset - txt の16進数の位置length - txt の16進数の長さpublic static byte[] toByteArray(char[] txt,
int radixBase)
txt - baae64までradixBase - 6までpublic static byte[] toByteArray(BigInteger num, int length)
num - バイト列をBigInteger にしたものlength - 最短バイト長public static byte[] toByte(short i)
i - 数値public static byte[] toByte(short i,
byte[] out,
int offset)
i - 数値out - 書き込む先offset - 書き込み位置public static byte[] toByte(int i)
i - 入力値public static byte[] toByte(int i,
byte[] out,
int offset)
i - 数値out - 書き込む先offset - 書き込み位置public static byte[] toByte(long l)
l - 入力値public static byte[] toByte(long l,
byte[] out,
int offset)
l - 数値out - 書き込む先offset - 書き込み位置public static byte[] and(byte[] a,
int aoffset,
byte[] b,
int boffset,
byte[] ret)
a - 長さの基準aoffset - aの開始位置b - boffset - bの開始位置ret - 長さの制限public static byte[] and(byte[] a,
byte[] b)
a - b - public static byte[] or(byte[] a,
int aoffset,
byte[] b,
int boffset,
byte[] ret)
a - 長さの基準aoffset - b - boffset - ret - public static byte[] or(byte[] a,
byte[] b)
public static byte[] xor(byte[] a,
int aoffset,
byte[] b,
int boffset,
byte[] ret,
int roffset)
a - aoffset - b - boffset - ret - roffset - public static byte[] xor(byte[] a,
byte[] b)
a - バイト列 長さの基準b - バイト列public static byte[] xorl(byte[] a,
byte[] b)
a - 結果もこっちへb - public static long[] xorl(long[] a,
long[] b)
a - b - public static long[] xor(long[] a,
int aoffset,
long[] b,
int boffset,
long[] ret)
a - 入力aaoffset - aのバイト位置b - 入力bboffset - bのバイト位置ret - 結果格納用public static long[] xor(long[] a,
long[] b)
a - 入力ab - 入力bpublic static byte[] not(byte[] a,
int aoffset,
byte[] ret)
public static byte[] not(byte[] a)
public static byte[] shl(byte[] a)
a - 元列public static long[] shl(long[] a)
a - 元列public static byte[] rol(byte[] a)
public static byte[] left(byte[] a,
int shift)
a - 配列shift - シフトビット数 とりあえず 0 から 7public static byte[] shr(byte[] a)
a - 元列public static int[] shr(int[] a)
a - 非破壊public static long[] shr(long[] a)
a - 非破壊public static byte[] ror(byte[] a)
a - 非破壊public static int[] ror(int[] a)
a - 非破壊public static long[] ror(long[] a)
a - 非破壊public static byte[] right(byte[] a,
int shift)
public static final int[] btoi(byte[] src)
src - byte列public static final long[] btol(byte[] src)
src - byte列public static byte[] itob(int[] src)
src - int配列public static byte[] ltob(long[] src)
src - long列public static final int[] ltoi(long[] src)
src - long列public static final long[] itol(int[] src)
src - int列public static final byte[] itob(int[] src,
int offset,
int len)
src - int列offset - 位置len - 長さpublic static final int[] btoi(byte[] src,
int offset,
int length)
src - byte列offset - 位置length - 長さpublic static final long[] btol(byte[] src,
int offset,
int length)
src - byte列offset - 位置length - 長さpublic static final int[] ltoi(long[] src,
int offset,
int length)
src - long列offset - src位置length - src長さpublic static byte[] ltob(long[] src,
int offset,
int srclen)
src - long列offset - src位置srclen - src長さpublic static final void btol(byte[] src,
int offset,
long[] dst,
int length)
src - 転送元byte列offset - 転送元位置dst - 転送先long列length - 転送先長public static final void itol(int[] src,
int offset,
long[] dst,
int length)
src - byte列offset - src位置dst - long列length - 長さpublic static void btoi(byte[] src,
int offset,
int[] dst,
int length)
src - バイト列offset - src位置dst - 戻りint列length - int長public static void ltoi(long[] src,
int offset,
int[] dst,
int length)
src - long列offset - src位置dst - 戻りint列length - 長さpublic static byte[] itob(int[] src,
byte[] ss,
int doffset)
src - ss - doffset - public static final byte[] ltob(long[] src,
byte[] ss,
int doffset)
src - ss - doffset - public static final void inc(byte[] src)
src - 数値1つぶんpublic static final void inc(long[] src)
src - 数値1つぶんCopyright © 2024. All rights reserved.