您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

16 行
422 B

  1. const assert = require("assert");
  2. const {
  3. stringToArrayBuffer,
  4. arrayBufferToHex,
  5. } = require("../src/stringEncoding");
  6. describe("stringEncoding", () => {
  7. it("stringToArrayBuffer", () => {
  8. assert.equal(stringToArrayBuffer("ȧ")[0], 200);
  9. assert.equal(stringToArrayBuffer("ȧ")[1], 167);
  10. });
  11. it("arrayBufferToHex", () => {
  12. assert.equal(arrayBufferToHex(new Uint8Array([200, 167])), "c8a7");
  13. });
  14. });