std.base64

Jump to: base64 Base64Exception Base64CharException encodeLength encode decodeLength decode
Encodes/decodes MIME base64 data.
将编码/解码 MIME base64 数据。

References:引用:
Wikipedia Base64
RFC 2045

class Base64Exception: object.Exception;

class Base64CharException: std.base64.Base64Exception;

uint encodeLength(uint slen);
Returns the number of bytes needed to encode a string of length slen.
返回编码的长度 slen 字符串所需的字节的数。

char[] encode(string str, char[] buf);
Encodes str[] and places the result in buf[].
将编码 str [] 并将结果放在 buf [] 中。

参数:

string str string to encode 字符串为 编码
char[] buf destination buffer, must be large enough for the result.
目标的缓冲区必须有足够的结果。

Returns:
slice into buf[] representing encoded result 到 buf [] 表示编码的结果片

string encode(string str);
Encodes str[] and returns the result.
将编码 str [] 并返回结果。

uint decodeLength(uint elen);
Returns the number of bytes needed to decode an encoded string of this length.
返回所需的这一编码的字符串解码的字节的数 长度。

char[] decode(string estr, char[] buf);
Decodes str[] and places the result in buf[].
解码 str [] 并将结果放在 buf [] 中。

Parameters:参数:
str string to encode要编码的字符串
char[] buf destination buffer, must be large enough for the result.
目标的缓冲区必须有足够的结果。
Returns:
slice into buf[] representing encoded result
到 buf [] 表示编码的结果片

Errors:
Throws Base64Exception on invalid base64 encoding in estr[]. Throws Base64CharException on invalid base64 character in estr[].
引发 Base64Exception 无效 base64 编码的 estr []。 引发 Base64CharException estr [] 无效 base64 特征。

string decode(string estr);
Decodes estr[] and returns the result.解码 estr[] 并返回结果。

Errors:
Throws Base64Exception on invalid base64 encoding in estr[]. Throws Base64CharException on invalid base64 character in estr[].
引发 Base64Exception 无效 base64 编码的 estr[]。 引发 Base64CharException estr [] 无效 base64 特征。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值