二进制到ASCII [英] Binary to ASCII

查看:84
本文介绍了二进制到ASCII的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以建议一种方法将二进制数据转换为ASCII数据,而内存增加很少或没有增加。问题

基本上是有一条消息,需要通过短信(手机)传送
。 SMS仅支持传输

可打印字符,即ASCII字符。我知道在

转换之后,大小变成原始数据的两倍。是否有人知道

做出转换的最佳方式。

解决方案

Wrecked说:

有人可以建议一种方法将二进制数据转换为ASCII数据,内存增加很少或没有增加。问题
基本上是有一条需要通过短信(手机)传输的消息。 SMS仅支持传输可打印的字符,即ASCII字符。我知道在
转换之后,大小变成原始数据的两倍。是否有人知道
任何更好,最佳的转换方式。




Base 64编码是表示文本中任意数据的规范方式

格式。因为它只能用一个字符代表六位,但是,b $ b,你将不得不忍受33%的数据增长。这个

肯定会加倍,对吧?


-

Richard Heathfield

" Usenet是一个奇怪的地方 - dmr 29/7/1999
http://www.cpax.org.uk

电子邮件:rjh在上面的域名(但显然放弃了www)


谢谢你...但是那是最好的我们可以得到..因为我将通过短信传输数据

,内存有点限制


Wrecked< ri********@gmail.com>写道:

谢谢...但是这是我们能得到的最好的...因为我将通过短信传输数据,内存是位约束



你可能不会低于base64(大约33%的大小

增加)。 base64只使用字母数字字符[a-zA-Z0-9]:如果

你的传输机制允许更多的符号,你可以实现你自己的编码,b $ b你自己的编码,类似于base64,但有更多的字符。


如果这对你来说仍然很重要,你可以考虑一些简单的

压缩与固定的霍夫曼table和base64编码压缩的

数据。


PS请包含您要回复的消息的上下文:引用

相关部分。如果你坚持使用破碎的谷歌界面,

学习以下简单的技巧:如果你回复邮件,首先点击

''options'',然后' '答复''。谷歌现在将包含您回复的
所引用的消息。

-

:wq

^ X ^ Cy ^ K ^ X ^ C ^ C ^ C ^ C


Could someone suggest a method to convert a Binary data to an ASCII
data, with very less or no increase in the memory . The problem
basically is there is an excrypted message which needs to be
transmitted via SMS (mobiles). SMS supports only transmitting of
printable char ie ASCII characters. I do know methords where in after
conversion the size becomes twice the original data. Does some one know
any better, optimal way to do the conversion.

解决方案

Wrecked said:

Could someone suggest a method to convert a Binary data to an ASCII
data, with very less or no increase in the memory . The problem
basically is there is an excrypted message which needs to be
transmitted via SMS (mobiles). SMS supports only transmitting of
printable char ie ASCII characters. I do know methords where in after
conversion the size becomes twice the original data. Does some one know
any better, optimal way to do the conversion.



Base 64 encoding is the canonical way to represent arbitrary data in text
format. Since it can only represent six bits with a single character,
however, you will have to put up with a 33% increase in data size. This
sure beats double, right?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)


thanks for that.. but is that the best we could get.. since i will have
to transmit data via SMS, memory is bit constraint


Wrecked <ri********@gmail.com> wrote:

thanks for that.. but is that the best we could get.. since i will have
to transmit data via SMS, memory is bit constraint



You probably can not go much lower then base64 (about 33% size
increase). base64 uses only alphanumeric characters [a-zA-Z0-9]: if
you''re transport mechanism allows for more symbols, you could implement
your own encoding, similar to base64, but with more characters.

If that''s still to much for you, you could consider some simple
compression with a fixed huffman table, and base64 encode the compressed
data.

P.S. Please include context of the message you are replying to: quote
the relevant parts. If you insist on using the broken google-interface,
learn the following simple trick: if you reply to a message, first click
''options'', then ''reply''. Google will now include the quoted message you
are replying to.
--
:wq
^X^Cy^K^X^C^C^C^C


这篇关于二进制到ASCII的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆