开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 778|回复: 3
收起左侧

[已解决] 关于JS“writeInt64”,“writeInt32”,“writeString”

 关闭 [复制链接]
结帖率:80% (4/5)
发表于 2021-8-7 22:22:04 | 显示全部楼层 |阅读模式   美国
10精币
  1.     s.BinBuffer.prototype.writeInt64 = function(t) {
  2. if (typeof t == "string") {
  3. this.allocate(8);
  4. for (var e = 0, i = 0, r = (t = t.toLowerCase()).length, s = 0; s < r; s++) {
  5. var o = t.charCodeAt(s) - 48;
  6. o > 9 && (o -= 39),
  7. e = 10 * e + o,
  8. i = 10 * i + Math.floor(e / 4294967296),
  9. e %= 4294967296
  10. }
  11. return this.vew.setUint32(this.position, i),
  12. this.vew.setUint32(this.position + 4, e),
  13. this.position += 8,
  14. void (this.len = this.position)
  15. }
  16. this.allocate(8),
  17. this.vew.setUint32(this.position, parseInt(t / 4294967296)),
  18. this.vew.setUint32(this.position + 4, t % 4294967296),
  19. this.position += 8,
  20. this.len = this.position
  21. }
  22. s.JceOutputStream.prototype.writeString = function(t, e) {
  23. var i = e;
  24. try {
  25. i = unescape(encodeURIComponent(i))
  26. } catch (t) {}
  27. i.length > 255 ? (this.writeTo(t, s.DataHelp.EN_STRING4),
  28. this.buf.writeUInt32(i["length"])) : (this.writeTo(t, s[DataHelp].EN_STRING1),
  29. this.buf.writeUInt8(i[length])),
  30. this.buf[writeString](i)
  31. }
  32. s.JceOutputStream.prototype.writeInt32 = function(t, e) {
  33. e >= -32768 && e <= 32767 ? this.writeInt16(t, e) : (this.writeTo(t, s.DataHelp.EN_INT32),
  34. this.buf.writeInt32(e))
  35. }
  36. s.BinBuffer.prototype.writeInt32 = function(t) {
  37. this.allocate(4),
  38. this.vew.setInt32(this.position, t),
  39. this.position += 4,
  40. this.len = this.position
  41. }
  42. s.BinBuffer.prototype.allocate = function(t) {
  43. if (t = this.position + t,
  44. !(null != this.buf && this.buf.length > t)) {
  45. var e = new ArrayBuffer(Math.max(256, 2 * t));
  46. null != this.buf && (new Uint8Array(e).buf(new Uint8Array(this.buf)),
  47. this.buf = void 0),
  48. this.buf = e,
  49. this.vew = void 0,
  50. this.vew = new DataView(this.buf)
  51. }
  52. }
  53. c.WSConnectParaInfo.prototype.writeTo = function (t) {

  54. t.writeInt64(0, this.lUid),
  55. t.writeString(1, this.sGuid),
  56. t.writeString(2, this.sUA),
  57. t.writeString(3, this.sAppSrc),
  58. t.writeString(4, this.sMid),
  59. t.writeString(5, this.sExp),
  60. t.writeInt32(6, this.iTokenType),
  61. t.writeString(7, this.sToken),
  62. t.writeString(8, this.sCookie)
  63. };
复制代码
如题,希望大佬不吝赐教,是真的想学点东西!




最佳答案

查看完整内容

https://bbs.125.la/forum.php?mod=viewthread&tid=14684558&extra=

回答提醒:如果本帖被关闭无法回复,您有更好的答案帮助楼主解决,请发表至 源码区 可获得加分喔。
友情提醒:本版被采纳的主题可在 申请荣誉值 页面申请荣誉值,获得 1点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
快捷通道:申请荣誉值无答案申请取消悬赏投诉有答案未采纳为最佳
结帖率:50% (1/2)

签到天数: 28 天

发表于 2021-8-7 22:22:05 | 显示全部楼层   广西壮族自治区贵港市
回复

使用道具 举报

结帖率:100% (4/4)

签到天数: 6 天

发表于 2021-8-7 22:55:43 | 显示全部楼层   浙江省衢州市
wasm嘛
回复

使用道具 举报

结帖率:0% (0/2)
发表于 2021-8-8 00:54:29 | 显示全部楼层   湖北省恩施土家族苗族自治州
感觉看不懂呀
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 诚聘英才| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 800073686,邮箱:800073686@b.qq.com
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

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