找回密码
 加入
搜索
查看: 3143|回复: 5

[AU3基础] (已解决)10进制转换成64进制请大侠翻译一下成autoit

[复制链接]
发表于 2013-9-24 13:18:23 | 显示全部楼层 |阅读模式
本帖最后由 scorpio1102 于 2013-9-27 14:33 编辑

网上找的64进制的实现代码如下:
  byte数组转换为64进制char数组
  public static char[] encode64Digit(byte[] bytes) {
  char[] out = new char[bytes.length << 1];
  for (int i = 0, j = 0; i < bytes.length; i++) {
  out[j++] = digits64[(0xC0 & bytes) >>> 6];
  out[j++] = digits64[0x3F & bytes];
  }
  return out;
  }
  64进制char数组转换为byte数组
  public static byte[] decode64Digit(char[] chars) {
  if ((0x01 & chars.length) != 0) {
  return null;
  }
  byte[] out = new byte[chars.length >> 1];
  for (int i = 0, j = 0; j < chars.length; i++) {
  int a = (getSize(chars[j]) << 6);
  j++;
  int b = getSize(chars[j]) & 0xFF;
  a = (a | getSize(chars[j]));
  j++;
  out = (byte) (a & 0xFF);
  }
  return out;
  }
以下Apache的commons-codec项目中针对16进制转换的方法代码如下:
  public static char[] encodeHex(byte[] data) {
  int l = data.length;
  char[] out = new char[l << 1];
  // two characters form the hex value.
  for (int i = 0, j = 0; i < l; i++) {
  out[j++] = DIGITS[(0xF0 & data) >>> 4 ];
  out[j++] = DIGITS[ 0x0F & data ];
  }
  return out;
  }
发表于 2013-9-24 22:53:55 | 显示全部楼层
本帖最后由 user3000 于 2013-9-24 22:56 编辑

我很想知道,  >>>  这个是什么运算?

网上搜了下:
“>>> 无符号右移,高位补0”; 与>>类似
 楼主| 发表于 2013-9-27 09:02:30 | 显示全部楼层
回复 2# user3000


    这是C++吧 完全不知道里面为什么要去这样运算,能力不够呀,有谁帮忙翻译一下呀.
发表于 2013-9-27 09:36:36 | 显示全部楼层
回复 3# scorpio1102

移位操作比乘除要快得多..
2^6 = 64
 楼主| 发表于 2013-9-27 14:00:38 | 显示全部楼层
本帖最后由 scorpio1102 于 2013-9-27 14:12 编辑

回复 4# annybaby


    这个听说过,只是想偷懒一下,希望有人整段翻译成autoit
 楼主| 发表于 2013-9-27 14:32:36 | 显示全部楼层
搜索到有人之前问过类似的问题
http://www.autoitx.com/forum.php ... ight=10%BD%F8%D6%C6
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-16 21:48 , Processed in 0.080706 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表