Tag: bert

如何提取node.js中的对象使用bert.js解码对象?

我有一个相当于这个BERT的对象(包含可读性): {"Hello",[{1,"john","john123"},{2,"Michale","michale123"}]} 在节点中: var S = Bert.bytes_to_string([131,104,2,107,0,5,72,101,108,108,111,108,0,0,0,2,104,3,97,1,107,0,4,106,111,104,110,107,0,7,106,111,104,110,49,50,51,104,3,97,2,107,0,7,77,105,99,104,97,108,101,107,0,10,109,105,99,104,97,108,101,49,50,51,106]); var Obj = Bert.decode(S); console.log(obj); 我可以在控制台中看到如下。 { '0': { type: 'bytelist', value: 'Hello', toString: [ Function ], repr: [ Function ] }, '1': [ { '0': 1, '1': [ Object ], '2': [ Object ], type: 'tuple', length: 3, value: [ Object ], repr: [ Function ], toString: […]